LinuxSir.cn,穿越时空的Linuxsir!

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

【號外】Portage 已經支援粗體了

[复制链接]
发表于 2005-8-21 01:23:17 | 显示全部楼层 |阅读模式
親?鄣男值芙忝么笫宕髬寕儯覀円呀洸恍枰a丁了,你只需要有:

  1. fontconfig Ver. 2.3.2
  2. freetype Ver. 2.1.10
  3. libXft Ver. 2.1.7
复制代码

這三個東東都在官方 Portage 中,其中也只有 libXft 的安裝需要一點手段,因爲它被 Masked,我們需要:

  1. echo ">=x11-libs/libXft-2.1.7" >> /etc/portage/package.unmask
  2. ACCEPT_KEYWORDS="~x86" emerge -O libXft
复制代码

補充一下,因爲 libXft 的相關依賴極多,所以我們需要加 -O ?韱为毎惭b它。
新的 fontconfig 的 fonts.conf 裏默認已經打開粗體的支援,不過我們還要做小小改動,在 /etc/fonts/fonts.conf 中找到這部分:

  1. <test target="pattern" name="weight" compare="more_eq">
  2.                         <int>[color=Red]200[/color]</int>
复制代码

將 200 改成 180 就 OK 了。至於字體的 prefer 設置就純屬個人喜好,這個是本人D:

  1. <?xml version="1.0"?>
  2. <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  3. <!-- /etc/fonts/fonts.conf file to configure system font access -->
  4. <fontconfig>

  5. <!--
  6.         DO NOT EDIT THIS FILE.
  7.         IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
  8.         LOCAL CHANGES BELONG IN 'local.conf'.

  9.         The intent of this standard configuration file is to be adequate for
  10.         most environments.  If you have a reasonably normal environment and
  11.         have found problems with this configuration, they are probably
  12.         things that others will also want fixed.  Please submit any
  13.         problems to the fontconfig bugzilla system located at fontconfig.org

  14.         Note that the normal 'make install' procedure for fontconfig is to
  15.         replace any existing fonts.conf file with the new version.  Place
  16.         any local customizations in local.conf which this file references.

  17.         Keith Packard
  18. -->

  19. <!-- Font directory list -->

  20.         <dir>/usr/share/fonts</dir>
  21.         <dir>/usr/share/fonts/local</dir>
  22.         <dir>/usr/local/share/fonts</dir>
  23.         <dir>/usr/X11R6/lib/X11/fonts/75dpi</dir>
  24.         <dir>/usr/X11R6/lib/X11/fonts/100dpi</dir>
  25.         <dir>~/.fonts</dir>

  26. <!--
  27.   Accept deprecated 'mono' alias, replacing it with 'monospace'
  28. -->
  29.         <match target="pattern">
  30.                 <test qual="any" name="family">
  31.                         <string>mono</string>
  32.                 </test>
  33.                 <edit name="family" mode="assign">
  34.                         <string>monospace</string>
  35.                 </edit>
  36.         </match>

  37. <!--
  38.   Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
  39. -->
  40.         <match target="pattern">
  41.                 <test qual="any" name="family">
  42.                         <string>sans serif</string>
  43.                 </test>
  44.                 <edit name="family" mode="assign">
  45.                         <string>sans-serif</string>
  46.                 </edit>
  47.         </match>

  48. <!--
  49.   Accept deprecated 'sans' alias, replacing it with 'sans-serif'
  50. -->
  51.         <match target="pattern">
  52.                 <test qual="any" name="family">
  53.                         <string>sans</string>
  54.                 </test>
  55.                 <edit name="family" mode="assign">
  56.                         <string>sans-serif</string>
  57.                 </edit>
  58.         </match>

  59. <!--
  60.   Mark common families with their generics so we'll get
  61.   something reasonable
  62. -->

  63. <!--
  64.   Serif faces
  65. -->
  66.         <alias>
  67.                 <family>Helvetica</family>
  68.                 <family>Bitstream Vera Serif</family>
  69.                 <family>Times New Roman</family>
  70.                 <family>Thorndale AMT</family>
  71.                 <family>Times</family>
  72.                 <family>Nimbus Roman No9 L</family>
  73.                 <family>Luxi Serif</family>
  74.                 <family>Kochi Mincho</family>
  75.                 <family>AR PL SungtiL GB</family>
  76.                 <family>AR PL Mingti2L Big5</family>
  77.                 <family>MS 明朝</family>
  78.                 <family>Baekmuk Batang</family>
  79.                 <family>FreeSerif</family>
  80.                 <family>SimSun</family>
  81.                 <family>MingLiu</family>
  82.                 <family>WebDings</family>
  83.                 <family>WingDings</family>
  84.                 <family>Verdana</family>
  85.                 <family>Tahoma</family>
  86.                 <default><family>serif</family></default>
  87.         </alias>
  88. <!--
  89.   Sans-serif faces
  90. -->
  91.         <alias>
  92.                 <family>Bitstream Vera Sans</family>
  93.                 <family>Helvetica</family>
  94.                 <family>Arial</family>
  95.                 <family>Albany AMT</family>
  96.                 <family>Nimbus Sans L</family>
  97.                 <family>Luxi Sans</family>
  98.                 <family>Kochi Gothic</family>
  99.                 <family>AR PL KaitiM GB</family>
  100.                 <family>AR PL KaitiM Big5</family>
  101.                 <family>MS ゴシック</family>
  102.                 <family>Baekmuk Dotum</family>
  103.                 <family>SimSun</family>
  104.                 <family>MingLiu</family>
  105.                 <family>WebDings</family>
  106.                 <family>WingDings</family>
  107.                 <family>FreeSans</family>
  108.                 <family>Verdana</family>
  109.                 <family>Tahoma</family>
  110.                 <default><family>sans-serif</family></default>
  111.         </alias>
  112. <!--
  113.   Monospace faces
  114. -->
  115.         <alias>
  116.                 <family>Helvetica</family>
  117.                 <family>Terminal</family>
  118.                 <family>Bitstream Vera Sans Mono</family>
  119.                 <family>Courier</family>
  120.                 <family>Courier New</family>
  121.                 <family>Andale Mono</family>
  122.                 <family>Luxi Mono</family>
  123.                 <family>Cumberland AMT</family>
  124.                 <family>Nimbus Mono L</family>
  125.                 <family>NSimSun</family>
  126.                 <family>FreeMono</family>
  127.                 <family>SimSun</family>
  128.                 <family>MingLiu</family>
  129.                 <family>WebDings</family>
  130.                 <family>WingDings</family>
  131.                 <family>Verdana</family>
  132.                 <family>Tahoma</family>
  133.                 <default><family>monospace</family></default>
  134.         </alias>
  135. <!--
  136.   If the font still has no generic name, add sans-serif
  137. -->
  138.         <match target="pattern">
  139.                 <test qual="all" name="family" compare="not_eq">
  140.                         <string>sans-serif</string>
  141.                 </test>
  142.                 <test qual="all" name="family" compare="not_eq">
  143.                         <string>serif</string>
  144.                 </test>
  145.                 <test qual="all" name="family" compare="not_eq">
  146.                         <string>monospace</string>
  147.                 </test>
  148.                 <edit name="family" mode="append_last">
  149.                         <string>sans-serif</string>
  150.                 </edit>
  151.         </match>

  152. <!--
  153.   URW provides metric and shape compatible fonts for these 3 Adobe families.
  154.   -->
  155.         <alias>
  156.           <family>Times</family>
  157.           <accept><family>Nimbus Roman No9 L</family></accept>
  158.         </alias>
  159.         <alias>
  160.           <family>Helvetica</family>
  161.           <accept><family>Nimbus Sans L</family></accept>
  162.         </alias>
  163.         <alias>
  164.           <family>Courier</family>
  165.           <accept><family>Nimbus Mono L</family></accept>
  166.         </alias>

  167. <!--
  168. AMT provides metric and shape compatible fonts for these three web font
  169. families.
  170. -->
  171.         <alias>
  172.                 <family>Times New Roman</family>
  173.                 <accept><family>Thorndale AMT</family></accept>
  174.         </alias>
  175.         <alias>
  176.                 <family>Arial</family>
  177.                 <accept><family>Albany AMT</family></accept>
  178.         </alias>
  179.         <alias>
  180.                 <family>Courier New</family>
  181.                 <accept><family>Cumberland AMT</family></accept>
  182.         </alias>

  183. <!--
  184.   Some Asian fonts misadvertise themselves as monospaced when
  185.   in fact they are dual-spaced (half and full).  This makes
  186.   FreeType very confused as it forces all widths to match.
  187.   Undo this magic by disabling the width forcing code -->
  188.         <match target="font">
  189.                 <test name="family"><string>GulimChe</string></test>
  190.                 <edit name="globaladvance"><bool>false</bool></edit>
  191.         </match>

  192.         <match target="font">
  193.                 <test name="family"><string>DotumChe</string></test>
  194.                 <edit name="globaladvance"><bool>false</bool></edit>
  195.         </match>

  196.         <match target="font">
  197.                 <test name="family"><string>BatangChe</string></test>
  198.                 <edit name="globaladvance"><bool>false</bool></edit>
  199.         </match>

  200.         <match target="font">
  201.                 <test name="family"><string>GungsuhChe</string></test>
  202.                 <edit name="globaladvance"><bool>false</bool></edit>
  203.         </match>

  204. <!--
  205.         The Bitstream Vera fonts have GASP entries suggesting that hinting be
  206.         disabled below 8 ppem, but FreeType ignores those, preferring to use
  207.         the data found in the instructed hints.  The initial Vera release
  208.         didn't include the right instructions in the 'prep' table. Fix this
  209.         by disabling hinting manually at smaller sizes (< 8ppem)
  210. -->

  211.         <match target="font">
  212.                 <test name="family">
  213.                         <string>Bitstream Vera Sans</string>
  214.                 </test>
  215.                 <test name="pixelsize" compare="less">
  216.                         <double>7.5</double>
  217.                 </test>
  218.                 <edit name="hinting">
  219.                         <bool>false</bool>
  220.                 </edit>
  221.         </match>

  222.         <match target="font">
  223.                 <test name="family">
  224.                         <string>Bitstream Vera Serif</string>
  225.                 </test>
  226.                 <test name="pixelsize" compare="less">
  227.                         <double>7.5</double>
  228.                 </test>
  229.                 <edit name="hinting">
  230.                         <bool>false</bool>
  231.                 </edit>
  232.         </match>

  233.         <match target="font">
  234.                 <test name="family">
  235.                         <string>Bitstream Vera Sans Mono</string>
  236.                 </test>
  237.                 <test name="pixelsize" compare="less">
  238.                         <double>7.5</double>
  239.                 </test>
  240.                 <edit name="hinting">
  241.                         <bool>false</bool>
  242.                 </edit>
  243.         </match>

  244. <!--
  245.   Load per-user customization file
  246. -->
  247.         <include ignore_missing="yes">~/.fonts.conf</include>

  248. <!--
  249.   Load local system customization file
  250. -->
  251.         <include ignore_missing="yes">conf.d</include>
  252.         <include ignore_missing="yes">local.conf</include>

  253. <!--
  254.   Provide required aliases for standard names
  255. -->
  256.         <alias>
  257.                 <family>serif</family>
  258.                 <prefer>
  259.                         <family>Verdana</family>
  260.                         <family>Bitstream Vera Serif</family>
  261.                         <family>Times New Roman</family>
  262.                         <family>Thorndale AMT</family>
  263.                         <family>Luxi Serif</family>
  264.                         <family>SimSun</family>
  265.                         <family>MingLiu</family>
  266.                         <family>Nimbus Roman No9 L</family>
  267.                         <family>Times</family>
  268.                         <family>Frank Ruehl</family>
  269.                         <family>Kochi Mincho</family>
  270.                         <family>AR PL SungtiL GB</family>
  271.                         <family>AR PL Mingti2L Big5</family>
  272.                         <family>MS 明朝</family>
  273.                         <family>Baekmuk Batang</family>
  274.                         <family>FreeSerif</family>
  275.                         <family>WebDings</family>
  276.                         <family>WingDings</family>
  277.                 </prefer>
  278.         </alias>
  279.         <alias>
  280.                 <family>sans-serif</family>
  281.                 <prefer>
  282.                         <family>Verdana</family>
  283.                         <family>Bitstream Vera Sans</family>
  284.                         <family>Arial</family>
  285.                         <family>Albany AMT</family>
  286.                         <family>SimSun</family>
  287.                         <family>MingLiu</family>
  288.                         <family>Luxi Sans</family>
  289.                         <family>Nimbus Sans L</family>
  290.                         <family>Nachlieli</family>
  291.                         <family>Kochi Gothic</family>
  292.                         <family>AR PL KaitiM GB</family>
  293.                         <family>AR PL KaitiM Big5</family>
  294.                         <family>MS ゴシック</family>
  295.                         <family>Baekmuk Dotum</family>
  296.                         <family>FreeSans</family>
  297.                         <family>WebDings</family>
  298.                         <family>WingDings</family>
  299.                 </prefer>
  300.         </alias>
  301.         <alias>
  302.                 <family>monospace</family>
  303.                 <prefer>
  304.                         <family>Terminal</family>
  305.                         <family>SimSun</family>
  306.                         <family>MingLiu</family>
  307.                         <family>Bitstream Vera Sans Mono</family>
  308.                         <family>Andale Mono</family>
  309.                         <family>Courier New</family>
  310.                         <family>Cumberland AMT</family>
  311.                         <family>Luxi Mono</family>
  312.                         <family>Nimbus Mono L</family>
  313.                         <family>Courier</family>
  314.                         <family>Miriam Mono</family>
  315.                         <family>Kochi Gothic</family>
  316.                         <family>AR PL KaitiM GB</family>
  317.                         <family>Baekmuk Dotum</family>
  318.                         <family>FreeMono</family>
  319.                         <family>WebDings</family>
  320.                         <family>WingDings</family>
  321.                 </prefer>
  322.         </alias>

  323. <!--
  324. Artificial oblique for fonts without an italic or oblique version
  325. -->

  326.         <match target="font">
  327.                 <!-- check to see if the font is roman -->
  328.                 <test name="slant">
  329.                         <const>roman</const>
  330.                 </test>
  331.                 <!-- check to see if the pattern requested non-roman -->
  332.                 <test target="pattern" name="slant" compare="not_eq">
  333.                         <const>roman</const>
  334.                 </test>
  335.                 <!-- multiply the matrix to slant the font -->
  336.                 <edit name="matrix" mode="assign">
  337.                         <times>
  338.                                 <name>matrix</name>
  339.                                 <matrix><double>1</double><double>0.2</double>
  340.                                         <double>0</double><double>1</double>
  341.                                 </matrix>
  342.                         </times>
  343.                 </edit>
  344.                 <!-- pretend the font is oblique now -->
  345.                 <edit name="slant" mode="assign">
  346.                         <const>oblique</const>
  347.                 </edit>
  348.         </match>

  349. <!--
  350. Synthetic emboldening for fonts that do not have bold face available
  351. -->

  352.         <match target="font">
  353.                 <!-- check to see if the font is just regular -->
  354.                 <test name="weight" compare="less_eq">
  355.                         <int>100</int>
  356.                 </test>
  357.                 <!-- check to see if the pattern requests bold -->
  358.                 <test target="pattern" name="weight" compare="more_eq">
  359.                         <int>180</int>
  360.                 </test>
  361.                 <!-- set the embolden flag -->
  362.                 <edit name="embolden" mode="assign">
  363.                         <bool>true</bool>
  364.                 </edit>
  365.         </match>


  366.         <config>
  367. <!--
  368.   These are the default Unicode chars that are expected to be blank
  369.   in fonts.  All other blank chars are assumed to be broken and
  370.   won't appear in the resulting charsets
  371. -->
  372.                 <blank>
  373.                         <int>0x0020</int>        <!-- SPACE -->
  374.                         <int>0x00A0</int>        <!-- NO-BREAK SPACE -->
  375.                         <int>0x00AD</int>        <!-- SOFT HYPHEN -->
  376.                         <int>0x034F</int>        <!-- COMBINING GRAPHEME JOINER -->
  377.                         <int>0x0600</int>        <!-- ARABIC NUMBER SIGN -->
  378.                         <int>0x0601</int>        <!-- ARABIC SIGN SANAH -->
  379.                         <int>0x0602</int>        <!-- ARABIC FOOTNOTE MARKER -->
  380.                         <int>0x0603</int>        <!-- ARABIC SIGN SAFHA -->
  381.                         <int>0x06DD</int>        <!-- ARABIC END OF AYAH -->
  382.                         <int>0x070F</int>        <!-- SYRIAC ABBREVIATION MARK -->
  383.                         <int>0x115F</int>        <!-- HANGUL CHOSEONG FILLER -->
  384.                         <int>0x1160</int>        <!-- HANGUL JUNGSEONG FILLER -->
  385.                         <int>0x1680</int>        <!-- OGHAM SPACE MARK -->
  386.                         <int>0x17B4</int>        <!-- KHMER VOWEL INHERENT AQ -->
  387.                         <int>0x17B5</int>        <!-- KHMER VOWEL INHERENT AA -->
  388.                         <int>0x180E</int>        <!-- MONGOLIAN VOWEL SEPARATOR -->
  389.                         <int>0x2000</int>        <!-- EN QUAD -->
  390.                         <int>0x2001</int>        <!-- EM QUAD -->
  391.                         <int>0x2002</int>        <!-- EN SPACE -->
  392.                         <int>0x2003</int>        <!-- EM SPACE -->
  393.                         <int>0x2004</int>        <!-- THREE-PER-EM SPACE -->
  394.                         <int>0x2005</int>        <!-- FOUR-PER-EM SPACE -->
  395.                         <int>0x2006</int>        <!-- SIX-PER-EM SPACE -->
  396.                         <int>0x2007</int>        <!-- FIGURE SPACE -->
  397.                         <int>0x2008</int>        <!-- PUNCTUATION SPACE -->
  398.                         <int>0x2009</int>        <!-- THIN SPACE -->
  399.                         <int>0x200A</int>        <!-- HAIR SPACE -->
  400.                         <int>0x200B</int>        <!-- ZERO WIDTH SPACE -->
  401.                         <int>0x200C</int>        <!-- ZERO WIDTH NON-JOINER -->
  402.                         <int>0x200D</int>        <!-- ZERO WIDTH JOINER -->
  403.                         <int>0x200E</int>        <!-- LEFT-TO-RIGHT MARK -->
  404.                         <int>0x200F</int>        <!-- RIGHT-TO-LEFT MARK -->
  405.                         <int>0x2028</int>        <!-- LINE SEPARATOR -->
  406.                         <int>0x2029</int>        <!-- PARAGRAPH SEPARATOR -->
  407.                         <int>0x202A</int>        <!-- LEFT-TO-RIGHT EMBEDDING -->
  408.                         <int>0x202B</int>        <!-- RIGHT-TO-LEFT EMBEDDING -->
  409.                         <int>0x202C</int>        <!-- POP DIRECTIONAL FORMATTING -->
  410.                         <int>0x202D</int>        <!-- LEFT-TO-RIGHT OVERRIDE -->
  411.                         <int>0x202E</int>        <!-- RIGHT-TO-LEFT OVERRIDE -->
  412.                         <int>0x202F</int>        <!-- NARROW NO-BREAK SPACE -->
  413.                         <int>0x205F</int>        <!-- MEDIUM MATHEMATICAL SPACE -->
  414.                         <int>0x2060</int>        <!-- WORD JOINER -->
  415.                         <int>0x2061</int>        <!-- FUNCTION APPLICATION -->
  416.                         <int>0x2062</int>        <!-- INVISIBLE TIMES -->
  417.                         <int>0x2063</int>        <!-- INVISIBLE SEPARATOR -->
  418.                         <int>0x206A</int>        <!-- INHIBIT SYMMETRIC SWAPPING -->
  419.                         <int>0x206B</int>        <!-- ACTIVATE SYMMETRIC SWAPPING -->
  420.                         <int>0x206C</int>        <!-- INHIBIT ARABIC FORM SHAPING -->
  421.                         <int>0x206D</int>        <!-- ACTIVATE ARABIC FORM SHAPING -->
  422.                         <int>0x206E</int>        <!-- NATIONAL DIGIT SHAPES -->
  423.                         <int>0x206F</int>        <!-- NOMINAL DIGIT SHAPES -->
  424.                         <int>0x3000</int>        <!-- IDEOGRAPHIC SPACE -->
  425.                         <int>0x3164</int>        <!-- HANGUL FILLER -->
  426.                         <int>0xFEFF</int>        <!-- ZERO WIDTH NO-BREAK SPACE -->
  427.                         <int>0xFFA0</int>        <!-- HALFWIDTH HANGUL FILLER -->
  428.                         <int>0xFFF9</int>        <!-- INTERLINEAR ANNOTATION ANCHOR -->
  429.                         <int>0xFFFA</int>        <!-- INTERLINEAR ANNOTATION SEPARATOR -->
  430.                         <int>0xFFFB</int>        <!-- INTERLINEAR ANNOTATION TERMINATOR -->
  431.                 </blank>
  432. <!--
  433.   Rescan configuration every 30 seconds when FcFontSetList is called
  434. -->
  435.                 <rescan>
  436.                         <int>30</int>
  437.                 </rescan>
  438.         </config>

  439. </fontconfig>
复制代码

大功告成,enjoy it  
发表于 2005-8-21 01:59:15 | 显示全部楼层
不是今天才有的吧?早就有了啊。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-21 02:50:33 | 显示全部楼层
Post by druggo
不是今天才有的吧?早就有了啊。



en.....我比較鄉下,現在才曉得,不過也沒見有論壇上的朋友提起啊,之前 Portage 裏也沒有 libXft 可以直接 emerge....所以...

Anyway,當是做總結好了,有經驗的朋友就當複習吧,?V爲告知,大家一齊? Gentoo :)
回复 支持 反对

使用道具 举报

发表于 2005-8-21 09:09:12 | 显示全部楼层
fontconfig似乎是要支持粗体的,新时代终于来了
关键是,选择字体里面是否有粗体和粗斜体规格?是否还要给pango打补丁?

谁能来张图?我想看看实际模拟后的伪粗体效果。
回复 支持 反对

使用道具 举报

发表于 2005-8-21 10:36:08 | 显示全部楼层
几个月前我都在用了,效果如下:
:cool:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2005-8-21 11:42:37 | 显示全部楼层
哈哈 过几天从新安装一下系统  体验一下
回复 支持 反对

使用道具 举报

发表于 2005-8-21 14:30:03 | 显示全部楼层
freetype-2.1.10有问题,读取X核心字体容易崩溃........................
回复 支持 反对

使用道具 举报

发表于 2005-8-21 14:38:54 | 显示全部楼层
另外,libXft会覆盖xorg-x11的某些文件(libXft.so.2),会导致一旦卸载libXft将使KDE无法正常启动(xorg自带的twm可以启动)。
回复 支持 反对

使用道具 举报

发表于 2005-8-21 16:30:43 | 显示全部楼层
Post by meteoren
freetype-2.1.10有问题,读取X核心字体容易崩溃........................



http://www.linuxsir.cn/bbs/showthread.php?t=213233
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-21 19:43:01 | 显示全部楼层
Post by meteoren
freetype-2.1.10有问题,读取X核心字体容易崩溃........................




经过反覆再反覆的来回折騰,確定一點問題都没有  
回复 支持 反对

使用道具 举报

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

本版积分规则

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