LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1179|回复: 6

wm字体渲染怎么设置?

[复制链接]
发表于 2009-2-9 16:41:13 | 显示全部楼层 |阅读模式
为了一个更好地显示效果,我很努力的改了自己的~/.fonts.conf,但是始终不能达到gnome中那种渲染效果。虽然laxapperance等可以代替Apperance Preferences来选择字体,如果想调整字体渲染怎么设置。如果是在字体配置文件中设置请教我。
发表于 2009-2-9 18:51:59 | 显示全部楼层
每个 DE 都有自己的渲染引擎,以前用 openbox 死活都是那种奇丑的字形。gnome 使用的 gnome-settings-daemon,只有启动这个进程(当然事先要在 gnome 里设置好后),其它 WM 才能达到那种效果。
回复 支持 反对

使用道具 举报

发表于 2009-2-9 20:19:22 | 显示全部楼层
试试把local.conf放到 /etc/fonts ,不保证有效。
  1. <?xml version="1.0"?>
  2. <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  3. <fontconfig>
  4. <!-- Generated by SuSEconfig.fonts, don't edit, your changes will get lost. -->
  5. <!-- Edit /etc/sysconfig/fonts-config instead.                              -->
  6. <!-- Or put rules into your personal config file ~/.fonts.conf.             -->
  7. <!-- ************************************************************ -->
  8. <!-- Hinting and antialiasing                                     -->
  9. <!-- ************************************************************ -->
  10.        <match target="pattern" >
  11.                <edit name="dpi" mode="assign" >
  12.                         <double>96</double>
  13.                 </edit>
  14.        </match>
  15. <!--
  16.     Using hinting=true, hintstyle=hintfull and antialias=true
  17.     is a good default for most fonts.
  18.     Match on "pattern" for the default, not on "font" to make
  19.     it easier to override the default using FcPatternDel()
  20.     and FcPatternAdd...() (see bugzilla #104365).
  21. -->
  22.         <match target="pattern">
  23.                 <edit name="hinting">
  24.                         <bool>true</bool>
  25.                 </edit>
  26.                 <edit name="hintstyle">
  27.                         <const>hintfull</const>
  28.                 </edit>
  29.                 <edit name="antialias">
  30.                         <bool>true</bool>
  31.                 </edit>
  32.         </match>
  33. <!--
  34.     Set autohinter=true as the default, then add exceptions for certain fonts.
  35.     Match on "font" here, not on "pattern" because of bug #118131 comment #93.
  36.     (If an autohint value is set in pattern, OpenOffice 2.1 will use that even
  37.     if there are fontconfig rules matching on "font" which should override it
  38.     again). This doesn't cause any problems for Cairo/Gnome (see bug #104365)
  39.     because Cairo/Gnome don't try to change the autohint value anyway.
  40. -->
  41.        
  42.         <match target="font">
  43.                 <edit name="autohint">
  44.                         <bool>true</bool>
  45.                 </edit>
  46.         </match>
  47.         <!--
  48.             Switch off the autohinter for PostScript fonts (Type 1 and OpenType CFF)
  49.             because using the PostScript hinting usually looks better than using
  50.             the autohinter.
  51.         -->
  52.         <match target="font">
  53.                 <test name="fontformat">
  54.                         <string>Type 1</string>
  55.                         <string>CFF</string>
  56.                 </test>
  57.                 <edit name="autohint">
  58.                         <bool>true</bool>
  59.                 </edit>
  60.         </match>
  61. <!--
  62.     TrueType Fonts which have high quality byte code interpreter
  63.     instructions can look very good in even in small sizes when using
  64.     the byte code interpreter (autohint=false). This is true
  65.     both with and without anti-aliasing.
  66.     In black and white (antialias=false) the results when rendering
  67.     with the byte code interpreter may even look as good as high quality
  68.     bitmap fonts.
  69.     On the other hand, some low quality TrueType Fonts do not have
  70.     byte code interpreter instructions at all or only very bad byte
  71.     code and may look better when the autohinter is used.
  72.     (See "FreeSans" for example, it looks better with the
  73.     autohinter which is especially obvious if anti-aliasing is off).
  74. -->
  75.         <!--
  76.             Switch off the autohinter for TrueType fonts in order
  77.             to use the byte code interpreter.
  78.         -->
  79.                
  80.         <match target="font">
  81.                 <test name="fontformat">
  82.                         <string>TrueType</string>
  83.                 </test>
  84.                 <edit name="autohint">
  85.                         <bool>true</bool>
  86.                 </edit>
  87.         </match>
  88.         <!--
  89.             Switch on the autohinter for a few TrueType fonts which
  90.             have no byte code or very bad byte code and look better
  91.             with the autohinter:
  92.             But see also bug #215602 for many fonts the autohinter
  93.             seriously distorts the metrics so badly that
  94.             even the digits which should be monospaced are not
  95.             monospaced at all anymore.
  96.             Because of this problem, better don't switch on
  97.             the autohinter for
  98.                Sazanami
  99.                IPA
  100.                DejaVu Sans Light
  101.                DejaVu Sans Condensed
  102.                DejaVu Serif Condensed
  103.                FreeSans
  104.                FreeSerif
  105.                FreeMono
  106.             and other fonts with similar problems until this is solved
  107.             in the autohinter.
  108.         -->
  109.         <match target="font">
  110.                 <test name="fontformat">
  111.                         <string>TrueType</string>
  112.                 </test>
  113.                 <test name="family">
  114.                         <string>Microsoft YaHei</string>
  115.                         <string>Vera Sans YuanTi</string>
  116.                         <string>Vera Sans YuanTi Mono</string>
  117.                         <string>MS PGothic</string>
  118.                         <string>MS UI Gothic</string>
  119.                         <string>MS Mincho</string>
  120.                         <string>MS PMincho</string>
  121.                         <string>HGPSoeiKakupoptai</string>
  122.                         <string>HGSGothicE</string>
  123.                         <string>HGSGothicM</string>
  124.                         <string>HGKyokashotai</string>
  125.                         <string>HGSSoeiKakugothicUB</string>
  126.                         <string>HGPGothicB</string>
  127.                         <string>HGPGothicE</string>
  128.                         <string>HGPGothicM</string>
  129.                         <string>HGSKyokashotai</string>
  130.                         <string>HGMaruGothicMPRO</string>
  131.                         <string>HGPSoeiKakugothicUB</string>
  132.                         <string>HGMinchoL</string>
  133.                         <string>HGPMinchoL</string>
  134.                         <string>HGMinchoB</string>
  135.                         <string>HGPMinchoB</string>
  136.                         <string>HGSMinchoB</string>
  137.                         <string>HGMinchoE</string>
  138.                         <string>HGPMinchoE</string>
  139.                         <string>HGSMinchoE</string>
  140.                         <string>HGSoeiKakugothicUB</string>
  141.                         <string>HGGyoshotai</string>
  142.                         <string>HGPGyoshotai</string>
  143.                         <string>HGSGyoshotai</string>
  144.                         <string>HGSoeiKakupoptai</string>
  145.                         <string>HGSSoeiPresenceEB</string>
  146.                         <string>HGPSoeiPresenceEB</string>
  147.                         <string>HGGothicB</string>
  148.                         <string>HGGothicE</string>
  149.                         <string>HGGothicM</string>
  150.                         <string>HGSoeiPresenceEB</string>
  151.                         <string>HGPKyokashotai</string>
  152.                         <string>HGSSoeiKakupoptai</string>
  153.                         <string>HGSeikaishotaiPRO</string>
  154.                         <string>TLKyokashotai</string>
  155.                         <string>TLMincho</string>
  156.                         <string>TLPMincho</string>
  157.                         <string>TLPGothic</string>
  158.                         <string>TLPKyokashotai</string>
  159.                         <string>TLMarugothicM</string>
  160.                         <string>TLGyoshotai</string>
  161.                         <string>TLPGyoshotai</string>
  162.                         <string>TLSGyoshotai</string>
  163.                         <string>TLPMarugothicM</string>
  164.                         <string>TLSMarugothicM</string>
  165.                         <string>TLSKyokashotai</string>
  166.                         <string>TLGothic</string>
  167.                 </test>
  168.                 <edit name="autohint">
  169.                         <bool>true</bool>
  170.                 </edit>
  171.         </match>
  172.         <!--
  173.             The following rule sets up black and white rendering with
  174.             the byte code interpreter for a small list of fonts which
  175.             are known to have good byte code and give bitmap quality
  176.             results at small sizes.
  177.             The pixelsize limit is set to '0' though, which effectively
  178.             disables this rule by default because most users don't like
  179.             that bitmap look and feel.
  180.             If you like a bitmap look and feel of your desktop,
  181.             copy this rule into your ~/.fonts.conf file and replace the '0'
  182.             with non-zero pixelsize limit. Using '18' as the pixelsize
  183.             limit is a good choice if you have the fonts in this list installed
  184.             and like a bitmap look and feel.
  185.         -->
  186.         <match target="font">
  187.                 <test name="family">
  188.                         <string>Microsoft YaHei</string>
  189.                         <string>Vera Sans YuanTi</string>
  190.                         <string>Vera Sans YuanTi Mono</string>
  191.                         <string>Andale Mono</string>
  192.                         <string>Arial</string>
  193.                         <string>Comic Sans MS</string>
  194.                         <string>Georgia</string>
  195.                         <string>Impact</string>
  196.                         <string>Trebuchet MS</string>
  197.                         <string>Verdana</string>
  198.                         <string>Courier New</string>
  199.                         <string>Times New Roman</string>
  200.                         <string>Tahoma</string>
  201.                         <string>Webdings</string>
  202.                         <string>Albany AMT</string>
  203.                         <string>Thorndale AMT</string>
  204.                         <string>Cumberland AMT</string>
  205.                         <string>Andale Sans</string>
  206.                         <string>Andy MT</string>
  207.                         <string>Bell MT</string>
  208.                         <string>Monotype Sorts</string>
  209.                 </test>
  210.                 <test name="pixelsize" compare="less_eq">
  211.                                 <double>0</double>
  212.                 </test>
  213.                 <edit name="autohint">
  214.                         <bool>true</bool>
  215.                 </edit>
  216.                 <edit name="antialias">
  217.                         <bool>true</bool>
  218.                 </edit>
  219.         </match>
  220. <!--
  221.   Some CJK fonts require the byte code interpreter to be rendered correctly.
  222.   These are composite fonts which store components and composing information
  223.   and compose the glyphs on the fly using the hinting instructions.
  224.   For all such fonts we switch off the autohinter here.
  225.   When "autohint" is set to "false", the byte code interpreter will
  226.   be used if it has been enabled at all when compiling freetype2.
  227.   The Chinese fonts "MingLiu" and "PMingLiU" used to belong to the fonts
  228.   which absolutely require the byte code interpreter to be rendered
  229.   correctly.
  230.   But apparently the new versions of "MingLiU" and "PMingLiU" from Windows
  231.   Vista are rendered correctly without the byte code interpreter.
  232. -->
  233.         <match target="font">
  234.                 <test name="family">
  235.                         <string>Microsoft YaHei</string>
  236.                         <string>MingLiU</string>
  237.                         <string>Vera Sans YuanTi</string>
  238.                         <string>Vera Sans YuanTi Mono</string>
  239.                         <string>PMingLiU</string>
  240.                 </test>
  241.                 <edit name="autohint">
  242.                         <bool>true</bool>
  243.                 </edit>
  244.         </match>
  245. <!--
  246. Hinting for CJK fonts in freetype doesn't yet work as well as for Latin fonts.
  247. Recently the autohinter in in freetype has been improved for CJK fonts
  248. a lot but it is still not perfect. Therefore one might want to switch
  249. off the autohinter for CJK fonts.
  250. This can be achieved by using the following rule:
  251.         <match target="font">
  252.                 <test name="lang" compare="contains">
  253.                         <string>ja</string>
  254.                         <string>zh</string>
  255.                         <string>ko</string>
  256.                 </test>
  257.                 <edit name="autohint">
  258.                         <bool>true</bool>
  259.                 </edit>
  260.         </match>
  261. -->
  262. <!--
  263. for some Bengali fonts (e.g. "Mukti Narrow"), the autohinter works well
  264. with the patch from http://www.kde.gr.jp/~akito/patch/freetype2/2.1.7
  265. applied. But for "Likhan" it still doesn't work that well
  266. (look how the "matra" lines at the top line up). Therefore, switch
  267. off the autohinter for the "Likhan" font:
  268. -->
  269.         <match target="font">
  270.                 <test name="family">
  271.                         <string>Likhan</string>
  272.                         <string>Microsoft YaHei</string>
  273.                         <string>Vera Sans YuanTi</string>
  274.                         <string>Vera Sans YuanTi Mono</string>
  275.                 </test>
  276.                 <edit name="autohint">
  277.                         <bool>true</bool>
  278.                 </edit>
  279.         </match>
  280. </fontconfig>
复制代码
回复 支持 反对

使用道具 举报

发表于 2009-2-9 20:45:43 | 显示全部楼层
Post by coderoar;1945564
每个 DE 都有自己的渲染引擎,以前用 openbox 死活都是那种奇丑的字形。gnome 使用的 gnome-settings-daemon,只有启动这个进程(当然事先要在 gnome 里设置好后),其它 WM 才能达到那种效果。

请不要误导LZ。

@LZ,wm里面,~/.fonts.conf 配置好,是绝对和 gnome 里面没半点区别,而且,没有了DE那些“便捷”的工具,你会更清楚里面之间的关系。

以前写的一篇日志,希望对你有点帮助。
http://www.oceanboo.cn/read.php/227.htm
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-10 09:29:02 | 显示全部楼层
Post by oceanboo;1945610
请不要误导LZ。

@LZ,wm里面,~/.fonts.conf 配置好,是绝对和 gnome 里面没半点区别,而且,没有了DE那些“便捷”的工具,你会更清楚里面之间的关系。

以前写的一篇日志,希望对你有点帮助。
http://www.oceanboo.cn/read.php/227.htm

Oceanboo 兄所说正合我意,谢谢诸位。
回复 支持 反对

使用道具 举报

发表于 2009-2-10 10:29:30 | 显示全部楼层
Post by oceanboo;1945610
wm里面,~/.fonts.conf 配置好,是绝对和 gnome 里面没半点区别,而且,没有了DE那些“便捷”的工具,你会更清楚里面之间的关系。

又回去用了下 openbox,感觉还是有些差距,~/.fonts.conf 我一直是修修补补的。
回复 支持 反对

使用道具 举报

发表于 2009-2-10 11:23:46 | 显示全部楼层
Post by coderoar;1945804
又回去用了下 openbox,感觉还是有些差距,~/.fonts.conf 我一直是修修补补的。


有空来 irc.oftc.net/#openbox-cn 里面讨论讨论。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表