Xorg server中的字体系统

本文深入解析了为何大部分程序员在职业生涯中未能晋升为架构师,从字体系统、核心配置到Xft特性,全面阐述了技术背景下的职业发展挑战。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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>


转载于:https://my.oschina.net/sskxyz/blog/402839

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值