fontconfig-voodoo是干啥用的?
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
- stlxv
- 论坛版主
- 帖子: 8275
- 注册时间: 2006-05-03 0:39
- 来自: المريخ
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
- adqin
- 帖子: 1417
- 注册时间: 2007-01-24 22:07
- 来自: http://adqin.cn
- 联系:
- stlxv
- 论坛版主
- 帖子: 8275
- 注册时间: 2006-05-03 0:39
- 来自: المريخ
- stlxv
- 论坛版主
- 帖子: 8275
- 注册时间: 2006-05-03 0:39
- 来自: المريخ
-
- 帖子: 36
- 注册时间: 2007-02-04 13:19
- 联系:
- skyx
- 论坛版主
- 帖子: 9202
- 注册时间: 2006-12-23 13:46
- 来自: Azores Islands
- 联系:
-
- 帖子: 1897
- 注册时间: 2006-09-12 14:09
- stlxv
- 论坛版主
- 帖子: 8275
- 注册时间: 2006-05-03 0:39
- 来自: المريخ
- stlxv
- 论坛版主
- 帖子: 8275
- 注册时间: 2006-05-03 0:39
- 来自: المريخ
忘了说了,这个东西是不能正常运行的,不管用什么参数,最终都是这样:
代码: 全选
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
- 联系:
可能是楼上的??做怪,我这里还好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
- 来自: المريخ
代码: 全选
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
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 !