如何使用Truetype字体中的内嵌点阵字体William Wei Xue, April 2008 在某些Truetype字体中会嵌入某些比较小的尺寸的点阵字体。那么为什么要在Truetype字体中嵌入点阵字体呢?这是因为这样可以提高小号字符的可视效果,可以让它看提来更清晰。如果你有一个含有内嵌点阵字体的 Truetype字体,那么你就可以按照自己的需要定制是否在指定的尺寸(字号)使用内嵌的点阵字体,或者只是按照正常的Truetype数据渲染字体的外形。当然,前提是必须在你的 Truetype字体文件中必须提供这些小尺寸的内嵌点阵字体。本文给出一个如何通过修改配置文件激活Uming Truetype 字体(uming.ttf)的实例。 Uming字体(uming.ttf)提供了 11, 12, 13, 14, 15 和 16像素尺寸的内嵌点阵字体。为了是大家明显的看出使用点阵字和没有使用的不同,使用Solrais提供的工具 /usr/openwin/bin/xmag 放大测试用的字符,并且截取图片。图1是可缩放字体,也据是Truetype字体在10pt的放大截图。10pt这个尺寸应该有相应的内嵌点阵字体的支持,(关于像素尺寸和绝对尺寸(pt磅)之间的转换请读者自行查阅)但是现在内嵌点阵字体被禁用,这里看到的是真正Truetype字体:
Figure 1: Scalable TrueType Font Without Embedded Bitmap Fonts 为了激活优先使用内嵌点阵字体,向如下那样修改配置文件 /etc/fonts/fonts.conf : <match target="font"> 在段“
Figure 2: Scalable TrueType Font With Embedded Bitmap Fonts 参考资料:
Comments (latest comments first)Discuss and comment on this resource in the BigAdmin Wiki
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
BigAdmin SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics | ||||