Ubuntu/字体
字体基本知识
编辑字符编码与字体
编辑计算机有自身的字符编码来表示字符。如ASCII中,十六进制数字41表示字母A。字符编码不能直接被显示为字符,就像41只能以二进制存储,不能显示为A。因此需要用到字体作为图形化显示、打印的媒介,将41映射到A。
对于一种字体,其每一个字符图形对应一个字符编码;而反过来则不一定,一个字符编码不一定能在此字体中找到对应的字符图形。通常一种字体是针对某一些语言设计的,所以需要适当的字体才能准确显示特定语言的内容。比如Libretion Sans字体只包含了拉丁字符,故不能显示中文字符。中文字体如文泉驿正黑能显示中文字符,这就是我们需要中文字体的原因。
矢量字体
编辑字体可分为点阵字体和矢量字体。点阵字体放大会产生锯齿,而矢量字体则可以保持平滑。
矢量字体是矢量图形,然而最终以位图形式显示在屏幕上。从矢量字体生成位图的过程叫做字体渲染。字体渲染的方法不同,会导致同一字体渲染的效果不同。Ubuntu和Windows 7的字体渲染效果不同是因为它们采用了不同的渲染方法:Windows 7字体锐利清晰;Ubuntu字体平滑美观。
字体文件
编辑字体是以字体文件形式存在的。TrueType矢量字体通常以.ttf结尾,是最常用的,被广泛支持的矢量字体格式。
在Ubuntu中,双击打开字体文件,即可用”字体察看器“打开,选择安装。安装字体其实是将字体文件复制到家目录的 .fonts 文件夹中了。该字体仅仅能被当前用户使用,而对其他用户无影响,属于用户字体。若想添加系统字体,需要将字体复制到 /usr/share/fonts/ 文件夹中。若要删除字体,只要删除对应的字体文件即可。
字体版权
编辑和绘画、音乐一样,字体也是拥有版权的。虽然大多数时候,您可以在未收到提醒的情况下直接安装字体,但并不意味着这样是合法的。
如果您要在自己的计算机上安装Windows系统字体,请确保您拥有此Windows系统的正版许可。该许可允许您在此计算机上使用这些字体。若您没有正版许可,那么这样做是不被允许的。
如果您想在计算机上安装受版权保护的字体,则必须购买使用许可。
Ubuntu系统字体均是自由授权的,您可以免费使用,并在Ubuntu软件中心中下载安装其他字体。比较受欢迎的中文字体有文泉驿系列字体,文鼎开源字体。
默认字体
编辑系统拥有默认字体。在没有特别说明的情况下,就以此字体为默认显示。默认字体即将字体按照优先级排序,排序结果即默认字体顺序。
衬线字体
编辑Serif,衬线字体,是一个字体族而非一种字体。当选择字体为Serif时,会显示Serif族默认字体,也就是默认衬线字体。衬线字体适合打印,而不适合液晶屏幕显示。
无衬线字体
编辑Sans Serif,或 Sans,无衬线字体,是一个字体族而非一种字体。当选择字体为Sans Serif时,会显示Sans Serif族默认字体,也就是默认无衬线字体。无衬线字体适合屏幕显示,而不适合打印。
等宽字体
编辑Monospace,或Mono,等宽字体,意思是每个字符宽度相同(一个中文字符宽度等于两个英文字符)。当选择Monospace时,会显示Monospace族默认字体,也就是默认等宽字体。等宽字体适合显示程序代码等需要对齐字符的文本。
字体替换
编辑如果所选字体无法显示当前字符,或者排在第一位的默认字体不能显示此字符的时候,系统会按照优先级寻找能够显示此字符的字体。因此,除非所有安装字体都无法显示此字符,系统总能找出对应的字体显示。
配置字体
编辑字体配置有两种形式,系统配置和用户配置。
系统配置更改系统配置文件,保存在/etc/fonts/fonts.conf文件中,作用影响每个用户。
用户配置更改用户配置文件,保存在家目录~/.fonts.conf文件中,仅影响此用户设置。
用户配置的优先级高于系统配置,因此当有用户配置时,会优先依照用户配置。出于安全性和可操作性考虑,建议使用用户配置。
用户配置
编辑用户配置即修改家目录中的.fonts.conf文件。这个文件默认是没有创建的,您需要新建此配置文件。
接下来就是要对各种字体进行优先级排序,分为三类:Sans,Serif,Mono。
文泉驿提供了一个简便的在线配置工具,可方便生成配置内容:
http://wenq.org/cloud/fcdesigner_local.html
拖动字体排序,完成后点击生成按钮,即可自动生成配置文件内容。将内容复制到.fonts.conf文件中,保存在家目录,完成配置。结果会立即生效,无需重启计算机。
也可按照下面的例子手动编辑,但过程较为繁琐:
.fonts.conf |
---|
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- created by WenQuanYi FcDesigner v0.5 -->
<match>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans</string>
<string>WenQuanYi Micro Hei</string>
<string>WenQuanYi Zen Hei</string>
<!-- Please install WenQuanYi Zen Hei first -->
<string>Liberation Sans</string>
<string>Droid Sans</string>
<string>WenQuanYi Bitmap Song</string>
<!-- Please install WenQuanYi Bitmap Song first -->
<string>AR PL UKai CN</string>
<string>AR PL UKai HK</string>
<string>AR PL UKai TW</string>
<string>AR PL UKai TW MBE</string>
<string>AR PL UMing CN</string>
<string>AR PL UMing HK</string>
<string>AR PL UMing TW</string>
<string>AR PL UMing TW MBE</string>
<string>Bitstream Charter</string>
<string>Century Schoolbook L</string>
<string>Courier 10 Pitch</string>
<!-- Please install Courier 10 Pitch first -->
<string>DejaVu Sans</string>
<string>DejaVu Sans Condensed</string>
<string>DejaVu Sans Light</string>
<string>DejaVu Sans Mono</string>
<string>DejaVu Serif</string>
<string>DejaVu Serif Condensed</string>
<string>Dingbats</string>
<string>Droid Sans</string>
<string>Droid Sans Mono</string>
<string>Droid Serif</string>
<string>FreeMono</string>
<string>FreeSans</string>
<string>FreeSerif</string>
<string>Garuda</string>
<string>KacstArt</string>
<string>KacstBook</string>
<string>KacstDecorative</string>
<string>KacstDigital</string>
<string>KacstFarsi</string>
<string>KacstLetter</string>
<string>KacstNaskh</string>
<string>KacstOffice</string>
<string>KacstOne</string>
<string>KacstPen</string>
<string>KacstPoster</string>
<string>KacstQurn</string>
<string>KacstScreen</string>
<string>KacstTitle</string>
<string>KacstTitleL</string>
<string>Kedage</string>
<string>Khmer OS</string>
<string>Khmer OS System</string>
<string>Kinnari</string>
<string>Liberation Mono</string>
<string>Liberation Sans</string>
<string>Liberation Sans Narrow</string>
<string>Liberation Serif</string>
<string>Lohit Bengali</string>
<string>Lohit Gujarati</string>
<string>Lohit Hindi</string>
<string>Lohit Punjabi</string>
<string>Lohit Tamil</string>
<string>Loma</string>
<string>Mallige</string>
<string>Meera</string>
<string>Mukti Narrow</string>
<string>Mukti Narrow Bold</string>
<string>NanumGothic</string>
<string>NanumMyeongjo</string>
<string>Nimbus Mono L</string>
<string>Nimbus Roman No9 L</string>
<string>Nimbus Sans L</string>
<string>Norasi</string>
<string>OpenSymbol</string>
<string>Phetsarath OT</string>
<string>Pothana2000</string>
<string>Purisa</string>
<string>Rachana</string>
<string>Rekha</string>
<string>Saab</string>
<string>Sawasdee</string>
<string>Standard Symbols L</string>
<string>Symbol</string>
<string>TakaoPGothic</string>
<string>Tlwg Typist</string>
<string>Tlwg Typo</string>
<string>TlwgMono</string>
<string>TlwgTypewriter</string>
<string>URW Bookman L</string>
<string>URW Chancery L</string>
<!-- Please install URW Chancery L first -->
<string>URW Gothic L</string>
<string>URW Palladio L</string>
<string>Ubuntu</string>
<string>Ubuntu Condensed</string>
<string>Ubuntu Light</string>
<string>Ubuntu Mono</string>
<string>Umpush</string>
<string>Untitled1</string>
<string>Vemana2000</string>
<string>Waree</string>
<string>gargi</string>
<string>mry_KacstQurn</string>
<string>utkal</string>
<string>文泉驿微米黑</string>
<string>文泉驿正黑</string>
<!-- Please install 文泉驿正黑 first -->
<string>文泉驿点阵正黑</string>
<string>文泉驿等宽微米黑</string>
<string>文泉驿等宽正黑</string>
</edit>
</match>
<match>
<test name="family"><string>serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Serif</string>
<string>WenQuanYi Bitmap Song</string>
<!-- Please install WenQuanYi Bitmap Song first -->
<string>AR PL UMing CN</string>
<string>AR PL SungtiL GB</string>
<string>WenQuanYi Zen Hei Sharp</string>
<string>AR PL UMing TW</string>
<string>Liberation Serif</string>
<string>Bitstream Charter</string>
<string>Droid Serif</string>
<string>AR PL UKai CN</string>
<string>AR PL UKai HK</string>
<string>AR PL UKai TW</string>
<string>AR PL UKai TW MBE</string>
<string>AR PL UMing CN</string>
<string>AR PL UMing HK</string>
<string>AR PL UMing TW</string>
<string>AR PL UMing TW MBE</string>
<string>Bitstream Charter</string>
<string>Century Schoolbook L</string>
<string>Courier 10 Pitch</string>
<!-- Please install Courier 10 Pitch first -->
<string>DejaVu Sans</string>
<string>DejaVu Sans Condensed</string>
<string>DejaVu Sans Light</string>
<string>DejaVu Sans Mono</string>
<string>DejaVu Serif</string>
<string>DejaVu Serif Condensed</string>
<string>Dingbats</string>
<string>Droid Sans</string>
<string>Droid Sans Mono</string>
<string>Droid Serif</string>
<string>FreeMono</string>
<string>FreeSans</string>
<string>FreeSerif</string>
<string>Garuda</string>
<string>KacstArt</string>
<string>KacstBook</string>
<string>KacstDecorative</string>
<string>KacstDigital</string>
<string>KacstFarsi</string>
<string>KacstLetter</string>
<string>KacstNaskh</string>
<string>KacstOffice</string>
<string>KacstOne</string>
<string>KacstPen</string>
<string>KacstPoster</string>
<string>KacstQurn</string>
<string>KacstScreen</string>
<string>KacstTitle</string>
<string>KacstTitleL</string>
<string>Kedage</string>
<string>Khmer OS</string>
<string>Khmer OS System</string>
<string>Kinnari</string>
<string>Liberation Mono</string>
<string>Liberation Sans</string>
<string>Liberation Sans Narrow</string>
<string>Liberation Serif</string>
<string>Lohit Bengali</string>
<string>Lohit Gujarati</string>
<string>Lohit Hindi</string>
<string>Lohit Punjabi</string>
<string>Lohit Tamil</string>
<string>Loma</string>
<string>Mallige</string>
<string>Meera</string>
<string>Mukti Narrow</string>
<string>Mukti Narrow Bold</string>
<string>NanumGothic</string>
<string>NanumMyeongjo</string>
<string>Nimbus Mono L</string>
<string>Nimbus Roman No9 L</string>
<string>Nimbus Sans L</string>
<string>Norasi</string>
<string>OpenSymbol</string>
<string>Phetsarath OT</string>
<string>Pothana2000</string>
<string>Purisa</string>
<string>Rachana</string>
<string>Rekha</string>
<string>Saab</string>
<string>Sawasdee</string>
<string>Standard Symbols L</string>
<string>Symbol</string>
<string>TakaoPGothic</string>
<string>Tlwg Typist</string>
<string>Tlwg Typo</string>
<string>TlwgMono</string>
<string>TlwgTypewriter</string>
<string>URW Bookman L</string>
<string>URW Chancery L</string>
<!-- Please install URW Chancery L first -->
<string>URW Gothic L</string>
<string>URW Palladio L</string>
<string>Ubuntu</string>
<string>Ubuntu Condensed</string>
<string>Ubuntu Light</string>
<string>Ubuntu Mono</string>
<string>Umpush</string>
<string>Untitled1</string>
<string>Vemana2000</string>
<string>Waree</string>
<string>gargi</string>
<string>mry_KacstQurn</string>
<string>utkal</string>
<string>文泉驿微米黑</string>
<string>文泉驿正黑</string>
<!-- Please install 文泉驿正黑 first -->
<string>文泉驿点阵正黑</string>
<string>文泉驿等宽微米黑</string>
<string>文泉驿等宽正黑</string>
</edit>
</match>
<match>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>WenQuanYi Zen Hei Mono</string>
<string>WenQuanYi Micro Hei Mono</string>
<string>DejaVu Sans Mono</string>
<string>Droid Sans Mono</string>
<string>WenQuanYi Zen Hei Sharp</string>
<string>Liberation Sans Mono</string>
<!-- Please install Liberation Sans Mono first -->
<string>AR PL UMing TW</string>
<string>AR PL UKai CN</string>
<string>AR PL UKai HK</string>
<string>AR PL UKai TW</string>
<string>AR PL UKai TW MBE</string>
<string>AR PL UMing CN</string>
<string>AR PL UMing HK</string>
<string>AR PL UMing TW</string>
<string>AR PL UMing TW MBE</string>
<string>Bitstream Charter</string>
<string>Century Schoolbook L</string>
<string>Courier 10 Pitch</string>
<!-- Please install Courier 10 Pitch first -->
<string>DejaVu Sans</string>
<string>DejaVu Sans Condensed</string>
<string>DejaVu Sans Light</string>
<string>DejaVu Sans Mono</string>
<string>DejaVu Serif</string>
<string>DejaVu Serif Condensed</string>
<string>Dingbats</string>
<string>Droid Sans</string>
<string>Droid Sans Mono</string>
<string>Droid Serif</string>
<string>FreeMono</string>
<string>FreeSans</string>
<string>FreeSerif</string>
<string>Garuda</string>
<string>KacstArt</string>
<string>KacstBook</string>
<string>KacstDecorative</string>
<string>KacstDigital</string>
<string>KacstFarsi</string>
<string>KacstLetter</string>
<string>KacstNaskh</string>
<string>KacstOffice</string>
<string>KacstOne</string>
<string>KacstPen</string>
<string>KacstPoster</string>
<string>KacstQurn</string>
<string>KacstScreen</string>
<string>KacstTitle</string>
<string>KacstTitleL</string>
<string>Kedage</string>
<string>Khmer OS</string>
<string>Khmer OS System</string>
<string>Kinnari</string>
<string>Liberation Mono</string>
<string>Liberation Sans</string>
<string>Liberation Sans Narrow</string>
<string>Liberation Serif</string>
<string>Lohit Bengali</string>
<string>Lohit Gujarati</string>
<string>Lohit Hindi</string>
<string>Lohit Punjabi</string>
<string>Lohit Tamil</string>
<string>Loma</string>
<string>Mallige</string>
<string>Meera</string>
<string>Mukti Narrow</string>
<string>Mukti Narrow Bold</string>
<string>NanumGothic</string>
<string>NanumMyeongjo</string>
<string>Nimbus Mono L</string>
<string>Nimbus Roman No9 L</string>
<string>Nimbus Sans L</string>
<string>Norasi</string>
<string>OpenSymbol</string>
<string>Phetsarath OT</string>
<string>Pothana2000</string>
<string>Purisa</string>
<string>Rachana</string>
<string>Rekha</string>
<string>Saab</string>
<string>Sawasdee</string>
<string>Standard Symbols L</string>
<string>Symbol</string>
<string>TakaoPGothic</string>
<string>Tlwg Typist</string>
<string>Tlwg Typo</string>
<string>TlwgMono</string>
<string>TlwgTypewriter</string>
<string>URW Bookman L</string>
<string>URW Chancery L</string>
<!-- Please install URW Chancery L first -->
<string>URW Gothic L</string>
<string>URW Palladio L</string>
<string>Ubuntu</string>
<string>Ubuntu Condensed</string>
<string>Ubuntu Light</string>
<string>Ubuntu Mono</string>
<string>Umpush</string>
<string>Untitled1</string>
<string>Vemana2000</string>
<string>Waree</string>
<string>gargi</string>
<string>mry_KacstQurn</string>
<string>utkal</string>
<string>文泉驿微米黑</string>
<string>文泉驿正黑</string>
<!-- Please install 文泉驿正黑 first -->
<string>文泉驿点阵正黑</string>
<string>文泉驿等宽微米黑</string>
<string>文泉驿等宽正黑</string>
</edit>
</match>
</fontconfig>
|