LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: sunmoon1997

为每一个字体优化的 local.conf

[复制链接]
发表于 2005-1-5 12:24:35 | 显示全部楼层
怎么用了之后,firefox里面的英文字体有些发虚阿
发表于 2005-1-5 12:36:14 | 显示全部楼层
Post by FunBOY
怎么用了之后,firefox里面的英文字体有些发虚阿

me 2.
试试我的这个:
  1. <?xml version="1.0"?>
  2. <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  3. <!-- /etc/fonts/local.conf file for local customizations -->
  4. <fontconfig>
  5.         <dir>/usr/share/fonts</dir>
  6.         <!-- <dir>/usr/share/fonts/ttf/zh_CN</dir> -->
  7.        
  8.         <!--
  9.           Enable sub-pixel rendering
  10.                 <match target="font">
  11.                         <test qual="all" name="rgba">
  12.                                 <const>unknown</const>
  13.                         </test>
  14.                         <edit name="rgba" mode="assign">
  15.                                 <const>rgb</const>
  16.                         </edit>
  17.                 </match>
  18.         -->
  19.        
  20.         <!--
  21.           Add by Firefly(firefly@firefly.idv.tw)
  22.         -->
  23.         <match target="font">
  24.                 <edit name="embeddedbitmap" mod="assign">
  25.                         <bool>true</bool>
  26.                 </edit>
  27.         </match>

  28.         <!--
  29.           Add by Firefly(firefly@firefly.idv.tw)
  30.           Most of Asian fonts can't explain by freetype2,
  31.           so,if these fonts have dual width(half/full) and monospacing,
  32.           you need to disable globaladvance.
  33.          -->
  34.         <match target="font">
  35.                 <test compare="more_eq" name="spacing">
  36.                         <const>dual</const>
  37.                 </test>
  38.                 <edit mode="assign" name="globaladvance">
  39.                         <bool>false</bool>
  40.                 </edit>
  41.         </match>

  42.         <!--
  43.          Add by firefly@firefly.idv.tw
  44.          Artificial bold for fonts without a bold version.
  45.          -->
  46.         <match target="font">
  47.                 <!-- check to see if the pattern requested> "medium" -->
  48.                 <test compare="more" target="pattern" name="weight">
  49.                         <const>medium</const>
  50.                 </test>
  51.                 <!-- pretend the font is bold now -->
  52.                 <edit mode="assign" name="weight">
  53.                         <const>bold</const>
  54.                 </edit>
  55.         </match>

  56.        
  57.         <!--
  58.         default settings for all fonts.
  59.         -->
  60.        
  61.         <match target="font">
  62.                 <edit mode="assign" name="antialias">
  63.                         <bool>true</bool>
  64.                 </edit>
  65.                 <edit mode="assign" name="hintstyle">
  66.                         <const>hintslight</const>
  67.                 </edit>
  68.                 <edit mode="assign" name="hint">
  69.                         <bool>true</bool>
  70.                 </edit>
  71.                 <edit mode="assign" name="autohint">
  72.                         <bool>false</bool>
  73.                 </edit>
  74.         </match>
  75.        
  76.         <match target="font">
  77.                 <test compare="contains" target="pattern" name="lang">
  78.                         <string>zh-cn</string>
  79.                         <string>zh-tw</string>
  80.                         <string>ja</string>
  81.                         <string>ko</string>
  82.                 </test>
  83.                 <test compare="eq" name="spacing">
  84.                         <const>mono</const>
  85.                 </test>
  86.                 <edit mode="assign" name="globaladvance">
  87.                         <bool>false</bool>
  88.                 </edit>
  89.         </match>
  90.        
  91.         <!--
  92.           Add by firefly@firefly.idv.tw
  93.         -->
  94.         <match target="font">
  95.                 <test compare="contains" name="lang">
  96.                         <string>zh-cn</string>
  97.                         <string>zh-tw</string>
  98.                         <string>ja</string>
  99.                         <string>ko</string>
  100.                 </test>
  101.                 <edit mode="assign" name="hint">
  102.                         <bool>true</bool>
  103.                 </edit>
  104.                 <edit mode="assign" name="autohint">
  105.                         <bool>false</bool>
  106.                 </edit>
  107.                 <edit mode="assign" name="hintstyle">
  108.                         <const>hintslight</const>
  109.                 </edit>
  110.                 <edit mode="assign" name="usegamma">
  111.                 <if>
  112.                         <less>
  113.                         <name>pixelsize</name>
  114.                                 <double>20</double>
  115.                         </less>
  116.                 </if>
  117.                 <bool>true</bool>
  118.                 </edit>
  119.         </match>

  120.         <!-- set the prefer fonts -->
  121.         <alias>
  122.                 <family>serif</family>
  123.                 <prefer>
  124.                         <family>Verdana</family>
  125.                         <family>Tahoma</family>
  126.                         <family>SimSun</family>
  127.                 </prefer>
  128.         </alias>
  129.         <alias>
  130.                 <family>sans-serif</family>
  131.                 <prefer>
  132.                         <family>Verdana</family>
  133.                         <family>Tahoma</family>
  134.                         <family>SimSun</family>
  135.                 </prefer>
  136.         </alias>
  137.         <alias>
  138.                 <family>monospace</family>
  139.                 <prefer>
  140.                         <family>Verdana</family>
  141.                         <family>Tahoma</family>
  142.                         <family>SimSun</family>
  143.                 </prefer>
  144.         </alias>

  145.         <!-- these 2 sections below are modified from Magic's  -->
  146.         <match target="font" >
  147.                 <test name="family" compare="eq">
  148.                         <string>SimSun</string>
  149.                         <string>NSimSun</string>
  150.                         <string>Tahoma</string>
  151.                         <string>Verdana</string>
  152.                 </test>
  153.                   <test compare="more" name="size" qual="any" >
  154.                           <double>8</double>
  155.                   </test>
  156.                   <test compare="less" name="size" qual="any" >
  157.                            <double>17</double>
  158.                   </test>
  159.                   <edit mode="assign" name="antialias" >
  160.                            <bool>false</bool>
  161.                   </edit>
  162.         </match>

  163.         <match target="font" >
  164.                 <test name="family" compare="eq">
  165.                         <string>SimSun</string>
  166.                         <string>NSimSun</string>
  167.                         <string>Tahoma</string>
  168.                         <string>Verdana</string>
  169.                 </test>
  170.                   <test compare="more" name="pixelsize" qual="any" >
  171.                            <double>8</double>
  172.                   </test>
  173.                   <test compare="less" name="pixelsize" qual="any" >
  174.                            <double>17</double>
  175.                   </test>
  176.                   <edit mode="assign" name="antialias" >
  177.                            <bool>false</bool>
  178.                   </edit>
  179.         </match>

  180.         <config>
  181.         <!--
  182.         Add by Firefly (firefly@firefly.idv.tw)
  183.         Output non English/Latin family name.
  184.         -->
  185.                 <familyoutput>
  186.                         <!--<const>auto</const>-->
  187.                         <const>englishonly</const>
  188.                         <!--        <const>any</const>        -->
  189.                 </familyoutput>
  190.         </config>

  191. </fontconfig>
复制代码
发表于 2005-1-5 22:47:51 | 显示全部楼层
这个好象不够清晰,根我原来的差不多
发表于 2005-1-5 23:19:14 | 显示全部楼层
应该解决ibm搜索框不能看见输入的问题
http://www-900.ibm.com/developerWorks/cn/linux/index.shtml
还有就是左边目录英文有可能不能显示的问题。
发表于 2005-1-6 01:07:38 | 显示全部楼层
ibm的问题找到了,不是我们的问题是ibm自己的问题,他当中的字体颜色竟然是白色。不知道是故意的?还是?
http://www-900.ibm.com/developerWorks/cn/css/ln1.css
发表于 2005-1-6 21:00:58 | 显示全部楼层
ibm那个,safari是没有问题的。
发表于 2005-1-6 21:37:59 | 显示全部楼层
这个是为nescape准备的样式,白色字体
.dwsearch { font-family: serif; color: #ffffff; font-size: small; }  
这个是为苹果准备的,字体黑色
.dwsearch { font-family: Verdana, sans-serif; color: #000000; font-size: 11px; }
发表于 2005-1-6 22:29:03 | 显示全部楼层
我用的时候有这样的警告,怎么处理
Fontconfig warning: "local.conf", line 192: unknown element "familyoutput"

Post by cocojumbal
me 2.
试试我的这个:
  1. <?xml version="1.0"?>
  2. <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  3. <!-- /etc/fonts/local.conf file for local customizations -->
  4. <fontconfig>
  5.         <dir>/usr/share/fonts</dir>
  6.         <!-- <dir>/usr/share/fonts/ttf/zh_CN</dir> -->
  7.        
  8.         <!--
  9.           Enable sub-pixel rendering
  10.                 <match target="font">
  11.                         <test qual="all" name="rgba">
  12.                                 <const>unknown</const>
  13.                         </test>
  14.                         <edit name="rgba" mode="assign">
  15.                                 <const>rgb</const>
  16.                         </edit>
  17.                 </match>
  18.         -->
  19.        
  20.         <!--
  21.           Add by Firefly(firefly@firefly.idv.tw)
  22.         -->
  23.         <match target="font">
  24.                 <edit name="embeddedbitmap" mod="assign">
  25.                         <bool>true</bool>
  26.                 </edit>
  27.         </match>

  28.         <!--
  29.           Add by Firefly(firefly@firefly.idv.tw)
  30.           Most of Asian fonts can't explain by freetype2,
  31.           so,if these fonts have dual width(half/full) and monospacing,
  32.           you need to disable globaladvance.
  33.          -->
  34.         <match target="font">
  35.                 <test compare="more_eq" name="spacing">
  36.                         <const>dual</const>
  37.                 </test>
  38.                 <edit mode="assign" name="globaladvance">
  39.                         <bool>false</bool>
  40.                 </edit>
  41.         </match>

  42.         <!--
  43.          Add by firefly@firefly.idv.tw
  44.          Artificial bold for fonts without a bold version.
  45.          -->
  46.         <match target="font">
  47.                 <!-- check to see if the pattern requested> "medium" -->
  48.                 <test compare="more" target="pattern" name="weight">
  49.                         <const>medium</const>
  50.                 </test>
  51.                 <!-- pretend the font is bold now -->
  52.                 <edit mode="assign" name="weight">
  53.                         <const>bold</const>
  54.                 </edit>
  55.         </match>

  56.        
  57.         <!--
  58.         default settings for all fonts.
  59.         -->
  60.        
  61.         <match target="font">
  62.                 <edit mode="assign" name="antialias">
  63.                         <bool>true</bool>
  64.                 </edit>
  65.                 <edit mode="assign" name="hintstyle">
  66.                         <const>hintslight</const>
  67.                 </edit>
  68.                 <edit mode="assign" name="hint">
  69.                         <bool>true</bool>
  70.                 </edit>
  71.                 <edit mode="assign" name="autohint">
  72.                         <bool>false</bool>
  73.                 </edit>
  74.         </match>
  75.        
  76.         <match target="font">
  77.                 <test compare="contains" target="pattern" name="lang">
  78.                         <string>zh-cn</string>
  79.                         <string>zh-tw</string>
  80.                         <string>ja</string>
  81.                         <string>ko</string>
  82.                 </test>
  83.                 <test compare="eq" name="spacing">
  84.                         <const>mono</const>
  85.                 </test>
  86.                 <edit mode="assign" name="globaladvance">
  87.                         <bool>false</bool>
  88.                 </edit>
  89.         </match>
  90.        
  91.         <!--
  92.           Add by firefly@firefly.idv.tw
  93.         -->
  94.         <match target="font">
  95.                 <test compare="contains" name="lang">
  96.                         <string>zh-cn</string>
  97.                         <string>zh-tw</string>
  98.                         <string>ja</string>
  99.                         <string>ko</string>
  100.                 </test>
  101.                 <edit mode="assign" name="hint">
  102.                         <bool>true</bool>
  103.                 </edit>
  104.                 <edit mode="assign" name="autohint">
  105.                         <bool>false</bool>
  106.                 </edit>
  107.                 <edit mode="assign" name="hintstyle">
  108.                         <const>hintslight</const>
  109.                 </edit>
  110.                 <edit mode="assign" name="usegamma">
  111.                 <if>
  112.                         <less>
  113.                         <name>pixelsize</name>
  114.                                 <double>20</double>
  115.                         </less>
  116.                 </if>
  117.                 <bool>true</bool>
  118.                 </edit>
  119.         </match>

  120.         <!-- set the prefer fonts -->
  121.         <alias>
  122.                 <family>serif</family>
  123.                 <prefer>
  124.                         <family>Verdana</family>
  125.                         <family>Tahoma</family>
  126.                         <family>SimSun</family>
  127.                 </prefer>
  128.         </alias>
  129.         <alias>
  130.                 <family>sans-serif</family>
  131.                 <prefer>
  132.                         <family>Verdana</family>
  133.                         <family>Tahoma</family>
  134.                         <family>SimSun</family>
  135.                 </prefer>
  136.         </alias>
  137.         <alias>
  138.                 <family>monospace</family>
  139.                 <prefer>
  140.                         <family>Verdana</family>
  141.                         <family>Tahoma</family>
  142.                         <family>SimSun</family>
  143.                 </prefer>
  144.         </alias>

  145.         <!-- these 2 sections below are modified from Magic's  -->
  146.         <match target="font" >
  147.                 <test name="family" compare="eq">
  148.                         <string>SimSun</string>
  149.                         <string>NSimSun</string>
  150.                         <string>Tahoma</string>
  151.                         <string>Verdana</string>
  152.                 </test>
  153.                   <test compare="more" name="size" qual="any" >
  154.                           <double>8</double>
  155.                   </test>
  156.                   <test compare="less" name="size" qual="any" >
  157.                            <double>17</double>
  158.                   </test>
  159.                   <edit mode="assign" name="antialias" >
  160.                            <bool>false</bool>
  161.                   </edit>
  162.         </match>

  163.         <match target="font" >
  164.                 <test name="family" compare="eq">
  165.                         <string>SimSun</string>
  166.                         <string>NSimSun</string>
  167.                         <string>Tahoma</string>
  168.                         <string>Verdana</string>
  169.                 </test>
  170.                   <test compare="more" name="pixelsize" qual="any" >
  171.                            <double>8</double>
  172.                   </test>
  173.                   <test compare="less" name="pixelsize" qual="any" >
  174.                            <double>17</double>
  175.                   </test>
  176.                   <edit mode="assign" name="antialias" >
  177.                            <bool>false</bool>
  178.                   </edit>
  179.         </match>

  180.         <config>
  181.         <!--
  182.         Add by Firefly (firefly@firefly.idv.tw)
  183.         Output non English/Latin family name.
  184.         -->
  185.                 <familyoutput>
  186.                         <!--<const>auto</const>-->
  187.                         <const>englishonly</const>
  188.                         <!--        <const>any</const>        -->
  189.                 </familyoutput>
  190.         </config>

  191. </fontconfig>
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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