Xorg server中的字体系统

Fonts in X11R7.7

原文链接

两种字体系统:core X11 fonts system 和 Xft fonts system,最初core fonts system只支持位图格式的字体,后来发展到可以支持scalable字体和可选转的象形字体。

字体安装:xft系统依赖fontconfig系统配置系统字体,fontconfig查找字体的默认目录(/usr/share/fonts/X11/*)、用户目录下的.fonts/,只需要把要安装的字体拷贝到这些目录中即可,系统会自动更新这些变更,也可以手动使用fc-cache命令触发这些变更。fontconfig的行为由一系列配置文件控制,标准的杯子文件/etc/fonts/fonts.conf,特定主机的配置文件/etc/fonts/local.conf”以及和特定用户相关的.fonts.conf文件,用户的配置文件可以使用FONTCONFIG_FILE环境变量设置。所有的配置文件格式:

以这样开始:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

以这样结束:

</fontconfig>

添加一个新的字体存放目录:<dir>/usr/local/share/fonts/winfonts/</dir>,为特定字体禁用anti-aliasing (font smoothing),使用语法:

<match target="font">
    <test qual="any" name="family">    //只针对某类字体设这
        <string>Lucida Console</string>
    </test>
    <edit name="antialias" mode="assign">
        <bool>false</bool>
    </edit>
</match>

为所有字体禁用anti-aliasing (font smoothing)

Anti-aliasing can be disabled for all fonts by the following incantation:

<match target="font">
    <edit name="antialias" mode="assign">
        <bool>false</bool>
    </edit>
</match>

Xft supports sub-pixel rasterisation on LCD displays.  X11R7.7 should automatically enable this feature on laptops and when using an LCD monitor connected with a DVI cable; you can check whether this was done by typing

$ xdpyinfo -ext RENDER | grep sub-pixel

如果没有任何输出,可以在配置文件中添加:

<match target="font">
    <edit name="rgba" mode="assign">
        <const>rgb</const>
    </edit>
</match>


你可能感兴趣的:(Xorg server中的字体系统)