Chinaunix首页 | 论坛 | 博客
  • 博客访问: 445585
  • 博文数量: 35
  • 博客积分: 747
  • 博客等级: 上士
  • 技术积分: 870
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-05 00:04
个人简介

执酒对饮桃花翩,醉踏歌剑挽流年。

文章分类

全部博文(35)

文章存档

2015年(1)

2014年(4)

2013年(2)

2012年(15)

2011年(13)

分类: LINUX

2012-02-14 19:55:25

安装好 archlinux 后,默认的字体显示效果,实在是……
按照 wiki,可以通过 AUR 安装经 Ubuntu 打过补丁的几个字体渲染包:
  1. # yaourt -S cairo-ubuntu freetype2-ubuntu fontconfig-ubuntu(2013-05-16 经过测试,已经不需要这两个包了)
接下来,配置使用的字体。首先安装所需字体:
  1. # pacman -S ttf-dejavu ttf-liberation wqy-zenhei ttf-arphic-ukai ttf-arphic-uming
网上很多都是说修改 /etc/fonts/local.conf  或是 /etc/fonts/conf.d/49-sansserif.conf 等系统文件,但是这样升级系统后,配置文件便会丢失。

其实只需要在 home 目录下创建 ~/.config/fontconfig/fonts.conf 文件,其编码为 UTF-8,其内容为:
  1. <?xml version='1.0'?>
  2. <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
  3. <fontconfig>
  4.     <match target="font">
  5.         <edit name="antialias" mode="assign"><bool>true</bool></edit>
  6.         <edit name="rgba" mode="append"><const>rgb</const></edit>
  7.         <edit name="lcdfilter" mode="append"><const>lcddefault</const></edit>
  8.         <edit name="autohint" mode="append"><bool>false</bool></edit>
  9.         <edit name="hinting" mode="assign"><bool>true</bool></edit>
  10.         <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
  11.     </match>

  12.     <alias binding="strong">
  13.         <family>serif</family>
  14.         <prefer>
  15.             <family>DejaVu Serif</family>
  16.             <family>WenQuanYi Zen Hei</family>
  17.         </prefer>
  18.     </alias>

  19.     <alias binding="strong">
  20.         <family>sans-serif</family>
  21.         <prefer>
  22.             <family>DejaVu Sans</family>
  23.             <family>WenQuanYi Zen Hei</family>
  24.         </prefer>
  25.     </alias>

  26.     <alias binding="strong">
  27.         <family>monospace</family>
  28.         <prefer>
  29.             <family>DejaVu Sans Mono</family>
  30.             <family>WenQuanYi Zen Hei Mono</family>
  31.         </prefer>
  32.     </alias>

  33.     <!-- To substitute some famous Chinese fonts -->
  34.     <match target="pattern">
  35.         <test name="family">
  36.             <string>宋体</string>
  37.         </test>
  38.         <edit name="family" mode="assign">
  39.             <string>SimSun</string>
  40.         </edit>
  41.     </match>

  42.     <match target="pattern">
  43.         <test name="family">
  44.             <string>新宋体</string>
  45.         </test>
  46.         <edit name="family" mode="assign">
  47.             <string>SimSun</string>
  48.         </edit>
  49.     </match>

  50.     <match target="pattern">
  51.         <test name="family">
  52.             <string>楷体</string>
  53.         </test>
  54.         <edit name="family" mode="assign">
  55.             <string>KaiTi</string>
  56.         </edit>
  57.     </match>

  58.     <match target="pattern">
  59.         <test name="family">
  60.             <string>楷体_GB2312</string>
  61.         </test>
  62.         <edit name="family" mode="assign">
  63.             <string>KaiTi</string>
  64.         </edit>
  65.     </match>

  66.     <match target="pattern">
  67.         <test name="family">
  68.             <string>黑体</string>
  69.         </test>
  70.         <edit name="family" mode="assign">
  71.             <string>SimHei</string>
  72.         </edit>
  73.     </match>

  74.     <match target="pattern">
  75.         <test name="family">
  76.             <string>微软雅黑</string>
  77.         </test>
  78.         <edit name="family" mode="assign">
  79.             <string>SimHei</string>
  80.         </edit>
  81.     </match>

  82.     <alias binding="strong">
  83.         <family>SimSun</family>
  84.         <accept>
  85.             <family>AR PL UMing CN</family>
  86.         </accept>
  87.     </alias>

  88.     <alias binding="strong">
  89.         <family>KaiTi</family>
  90.         <accept>
  91.             <family>AR PL UKai CN</family>
  92.         </accept>
  93.     </alias>

  94.     <alias binding="strong">
  95.         <family>SimHei</family>
  96.         <accept>
  97.             <family>WenQuanYi Zen Hei</family>
  98.         </accept>
  99.     </alias>

  100.     <!-- To substitute some English fonts -->
  101.     <alias binding="strong">
  102.         <family>BookAntiqua</family>
  103.         <accept>
  104.             <family>URW Palladio L</family>
  105.         </accept>
  106.     </alias>

  107.     <alias binding="strong">
  108.         <family>Georgia</family>
  109.         <accept>
  110.             <family>Liberation Serif</family>
  111.         </accept>
  112.     </alias>

  113.     <alias binding="strong">
  114.         <family>Verdana</family>
  115.         <accept>
  116.             <family>Liberation Sans</family>
  117.         </accept>
  118.     </alias>

  119.     <alias binding="strong">
  120.         <family>Calibri</family>
  121.         <accept>
  122.             <family>Liberation Sans</family>
  123.         </accept>
  124.     </alias>

  125. </fontconfig>
注销后登录,便可以看到美观漂亮的字体显示了。
阅读(13833) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~