- 论坛徽章:
- 0
|
前言:
字体可能是你的显示乱码的原因所在,这时它影响你的基本需求;字体可能是你的显示美观的原因所在,这是它影响你的性能需求;本文更注重前一种,因为我是一个技术人员,向来对美追求不够,而只在意那能与不能。在此之前,看了无数网络文章,天啊,都是一些技巧性的东西,都是要有条件或环境支持的,就像在掷骰子,因为幸运所以成功了,因为幸运所以文章被google到了。这回我可不能这样了。
正文:
1.Type of font
1.1 Bitmap Fonts 点阵字体
以固定大小的矩阵像素为基本单位的图像式字体。不可伸缩,当你在不同分辨率的显示器上显示的大小相同。分为打印与屏幕两类。因为其不可伸缩性不宜打印,因此不推荐使用。主要应用于终端屏幕显示。
1.2 Type1 Fonts
由Adobe公司发明,受到PostScript standard的支持。在发展过程中出现了afm,pfb,pfa,pfm等多种标准。
1.3 Type3 Fonts
Type1的简化版,没有得到x的支持。
1.4 TrueType Fonts
由Apple公司发明,集合了MicroSoft与Adobe的一些特性,并抢夺了Adobe的大量市场,越来越流行。它可以将公尺及形状集合在同一个文件当中。以.ttf做扩展名。
1.5 Type 42 Fonts
一种带有PostScrip可转换信息头的TrueType。
////Type1 VS TrueType
主要差别在于应用程序对它们的支持。在Windows上TrueType主导,在Linux,Unix上Type1占优。特色上相差不多。
1.6 MetaFont
由Donald E. Knuth发明做为TeX typesetting
system的一部分。其特色是使大字更优美,小字更易读。
1.7 Families of Typefaces
是很多字体如粗体,斜体……的变化。一种字体及它的变体被称为a family of typefaces。
2.Making Fonts Available for X
2.1 The font path
添加一个字体路径:使x程序可以到这些路径中去找恰当的字体
2.1.1
xset fp /myfontpath
xset fp rehash //可以将之添加到.xinitrc,.xsession等脚本中
2.1.2
修改xorg.conf文件
...
Section "Files"
...
FontPath /usr/share/fonts/myfonts //路径是自定义的
...
EndSection
...
2.2 Install Type 1 fonts
Run Type1inst utility type1inst tool, then run $set fp rehash or modify xorg.conf file
2.3 Install True Type Fonts
2.3.1 xfstt //一种字体服务器,不常用
2.3.2 xfs //流行的字体服务器,可以为网络上的xwindow服务
***通过在xorg.conf中adding unix/:port来将xfs所检测并维护的字体目录加入其中
***修改xfs维护的字体路径
Users of other distributions can edit the configuration file(/etc/X11/fs/config) as follows:
catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled,
...
/usr/share/fonts/my_new_fonts/,
...
/usr/share/fonts/some_other_directory
# in 12 points, decipoints
default-point-size = 120
...
The above would add /usr/share/fonts/my_new_fonts/ to the xfs font path.
/etc/init.d/xfs reload|restart //使之生效,最好重启x
***安装新字体到xfs
1.安装xfs
2.放新字体到目标目录
3.
type1 fonts run type1inst
true type fonts:
download true type fonts to dir_path/
cd dir_path/
ttmkdir -o fonts.scale //如果是新目录,还要cp或链接fonts.scale成fonts.dir.ttmkfdir is part of the freetype package
添加这个目录到xfs,按上面的方法
查看xfs运行端口: cat /etc/services|grep xfs
查看x字体路径: xset -q //如果Font Path中有类似unix/:7100的内容,则说明xfs正确,否则要将其加入xorg.conf
/etc/rc.d/init.d/xfs restart //重启xfs
重启x
参考:
Linux font HOWTO
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11171/showart_297704.html |
|