fontconfig-voodoo是干啥用的?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

fontconfig-voodoo是干啥用的?

#1

帖子 stlxv » 2007-04-22 18:04

作用是啥? -f -s又是做什么的?
PHP是最好的语言!不服来战!
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#2

帖子 skyx » 2007-04-22 22:38

难道3dfx 的voodoo没落到render字体啦?
no security measure is worth anything if an attacker has physical access to the machine
头像
adqin
帖子: 1417
注册时间: 2007-01-24 22:07
来自: http://adqin.cn
联系:

#3

帖子 adqin » 2007-04-22 23:06

雕兄,请你替大家解释解释。
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#4

帖子 stlxv » 2007-04-23 19:16

skyx 写了:难道3dfx 的voodoo没落到render字体啦?
虽然我完全明白你说的每一个单词的意思和背景,但是,还是没看懂你在说什么%…… :?
PHP是最好的语言!不服来战!
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#5

帖子 stlxv » 2007-04-23 19:16

adqin 写了:雕兄,请你替大家解释解释。
可能也不清楚吧,或者,没看到这个贴?
PHP是最好的语言!不服来战!
cooldgjk
帖子: 36
注册时间: 2007-02-04 13:19
联系:

#6

帖子 cooldgjk » 2007-04-23 19:22

看起来像是巫毒显卡的字体配置工具.
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#7

帖子 skyx » 2007-04-23 19:33

cooldgjk 写了:看起来像是巫毒显卡的字体配置工具.
看起来更像linux配制字体采用了巫毒显卡的部分算法
no security measure is worth anything if an attacker has physical access to the machine
雕啸长空
帖子: 1897
注册时间: 2006-09-12 14:09

#8

帖子 雕啸长空 » 2007-04-23 20:18

stlxv 写了:
adqin 写了:雕兄,请你替大家解释解释。
可能也不清楚吧,或者,没看到这个贴?
刚看到,也不懂;

执行这个命令后中文字体就好看了,不然很模糊而且很色彩非常淡.
Fair winds and following seas !
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#9

帖子 stlxv » 2007-04-24 0:21

雕啸长空 写了:
stlxv 写了:
adqin 写了:雕兄,请你替大家解释解释。
可能也不清楚吧,或者,没看到这个贴?
刚看到,也不懂;

执行这个命令后中文字体就好看了,不然很模糊而且很色彩非常淡.
为什么我从来都不觉得????好吧,我来试下,看看我一直不管截图还是亲自使用都觉得超级难看的yahei会不会变漂亮点。

P.S. 你看我的截图,里面有“字体渲染”选项,这种事情是不需要用这种复杂的命令来完成的。而且这个脚本做得十分不完善
附件
screenshot1.png
PHP是最好的语言!不服来战!
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#10

帖子 stlxv » 2007-04-24 0:23

忘了说了,这个东西是不能正常运行的,不管用什么参数,最终都是这样:

代码: 全选

stlxv@stlxvcomputer:~$ sudo fontconfig-voodoo -f -s zh_CN
Password:
Traceback (most recent call last):
  File "/usr/bin/fontconfig-voodoo", line 7, in <module>
    from LanguageSelector import FontConfig
ImportError: No module named LanguageSelector
PHP是最好的语言!不服来战!
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#11

帖子 skyx » 2007-04-24 0:29

stlxv 写了:忘了说了,这个东西是不能正常运行的,不管用什么参数,最终都是这样:

代码: 全选

stlxv@stlxvcomputer:~$ sudo fontconfig-voodoo -f -s zh_CN
Password:
Traceback (most recent call last):
  File "/usr/bin/fontconfig-voodoo", line 7, in <module>
    from LanguageSelector import FontConfig
ImportError: No module named LanguageSelector
可能是楼上的??做怪,我这里还好
no security measure is worth anything if an attacker has physical access to the machine
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#12

帖子 stlxv » 2007-04-24 0:29

代码: 全选

stlxv@stlxvcomputer:~$ cat /usr/bin/fontconfig-voodoo 
#!/usr/bin/python

import os
import sys
from optparse import OptionParser

from LanguageSelector import FontConfig
from gettext import gettext as _


def main():
    
    def abort(msg=None):
        " helper for a clean abort "
        if not options.silent:
            if msg:
                print msg
            print _("Aborting")
        sys.exit(1)

    usage = "usage: %prog [options]"
    # init the option parser
    parser = OptionParser(usage)
    parser.add_option("-f", "--force", dest="force",
                      action="store_true",
                      help=_("Force even when a configuration exists"))
    parser.add_option("-s", "--set", dest="lang",
                      help=_("Set fontconfig voodoo for the selected "
                             "language"))
    parser.add_option("-a", "--auto", dest="auto",
                      action="store_true",
                      help=_("Guess a configuration based on the "
                             "LANGUAGE environment. Sets the config to "
                             "'none' if nothing suitable was found"))
    parser.add_option("-l", "--list", dest="list",
                      action="store_true",
                      help=_("List the available fontconfig-voodoo configs"))
    parser.add_option("-c", "--current", dest="show_current",
                      action="store_true",
                      help=_("Show the current fontconfig-voodoo config"))
    parser.add_option("-q", "--quiet",
                      action="store_true", dest="silent", default=False)

    # check if we have arguments at all
    if len(sys.argv[1:]) == 0:
        parser.print_help()
        sys.exit(0)

    # parse them
    (options, args) = parser.parse_args()

    # do the work
    fc = FontConfig.FontConfigHack()

    if options.show_current:
        try:
            if options.silent:
                print fc.getCurrentConfig()
            else:
                print "Current config: %s" % fc.getCurrentConfig()
        except FontConfig.ExceptionUnconfigured:
            print _("Unconfigured")
        sys.exit(0)

    if options.list:
        print "\n".join(fc.getAvailableConfigs())
        sys.exit(0)
        
    if os.path.exists(fc.configFile) and not options.force:
        abort(_("A configuration exists already. Use '--force' to "
                "overwrite it. "))

    if options.auto:
        try:
            fc.setConfigBasedOnLocale()
        except FontConfig.ExceptionNoConfigForLocale:
            pass

    if options.lang:
        try:
            fc.setConfig(options.lang)
        except FontConfig.ExceptionNoConfigForLocale:
            abort(_("No fontconfig-voodoo configuration found for the "
                    "selected locale"))
    
    
if __name__ == "__main__":
    main()
PHP是最好的语言!不服来战!
雕啸长空
帖子: 1897
注册时间: 2006-09-12 14:09

#13

帖子 雕啸长空 » 2007-04-24 1:01

adqin 写了:雕兄,请你替大家解释解释。
We could have better fonts for some languages (e.g. Arabic). We need to evaluate what fonts are available and under what license we can use them. (See OpenFonts).We should also make the "fontconfig-voodoo" mechanism available via the interface (e.g. via a advanced tab). This way people can optimize their font settings for e.g. Chinese fonts even if they use a English system by default.
Fair winds and following seas !
回复