当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > RedHat 6.2 中文 TrueType 字体的使用

Unix/Linux
FREEBSD软件安装
FREEBSD6.0 架设FTP 服务器
FreeBSD用port安装JDK和Jboss
FreeBSD软件安装卸载工具--Ports和Packages详解
FreeBSD 里面用设置 ADSL宽带上网
FreeBSD防止ARP攻击
FreeBSD下安装J2EE开发环境
FreeBSD6.2架设FTP服务器详解
ssh 命令说明
openbsd4.1+apache+mysql+php 环境配置
OpenBSD挂载cdrom, iso, usb的方法
FREEBSD 的使用知识
Freebsd6.0下通过ports安装apache2.2.0+mysql5.1.7+php5.1.2
FreeBSD常用命令集
FreeBSD中使用QUOTA(磁盘配额)来限制用户空间
简单更新ports tree 的方法
通过posts安装 OpenSSH
谈谈FreeBSD软件安装方法
FreeBSD下一块网卡绑定多个IP的方法
BSD下vi用法详解

Unix/Linux 中的 RedHat 6.2 中文 TrueType 字体的使用


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 110 ::
收藏到网摘: n/a

 
以下是使用步聚: 

建立字体存放目录,如: 

$ mkdir /usr/X11R6/lib/X11/fonts/TrueType 

使用 Windows 所带的字体: 

$ cd "where_is_your_windows"/fonts/ 
$ cp simsun.ttf /usr/X11R6/lib/X11/fonts/TrueType <-- 拷贝简宋体 

生成 fonts.dir 文件 

$ cd /usr/X11R6/lib/X11/fonts/TrueType 
$ ttmkfdir > fonts.dir 

注:mkfontdir 用于生成点阵字体的 fonts.dir 文件,ttmkfdir 用于生成 TrueType 字体的 fonts.dir 文件。 

由于 ttmkfdir 不能识某些汉字TTF的编码,需手工修改。 

生成的 fonts.dir 如下: 

fonts.dir 
====== 

simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-ascii-0 

改为: 

simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0 

生成 fonts.alias 文件 

$ cat fonts.dir > fonts.alias 

将 fonts.alias 内容改为: 

SimSun -misc-SimSun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0 

将字体路径加入配置: 

如果你的字体搜索路径是 FontPath "unix/:-1" 的话,说明你是使用 xfs 作为字体搜索代理的,这是 RedHat 的默认配置。此配置适用于网络用户,对于PC用户并无意义。建议在 XFree86 的配置文件中直接指定常用字体搜索路径。以下对这两种方法的设置做个简要的说明: 

1. 使用 xfs (RedHat 的默认配置) 

勿需修改 /etc/X11/XF86Config 文件。 

$ su 
# chkfontpath -add /usr/X11R6/lib/X11/fonts/TrueType 

如无问题的话,可使用 chkfontpath --list 显示所有的搜索路径。 

2. 不使用 xfs (推荐) 

打开 /etc/X11/XF86Config 文件,将原 FontPath 取消: 

# FontPath "unix/:-1" 

加入所有的字体路径: 

FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled" 
FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled" 
FontPath "/usr/X11R6/lib/X11/fonts/misc" 
FontPath "/usr/X11R6/lib/X11/fonts/Type1" 
FontPath "/usr/X11R6/lib/X11/fonts/Speedo" 
FontPath "/usr/X11R6/lib/X11/fonts/75dpi" 
FontPath "/usr/X11R6/lib/X11/fonts/TrueType" 

取消 xfs 的后台执行: 

# setup 

在 System services 中取消 xfs。 

启动 X,查看中文TTF字体: 

$ xfd -fn simsun & <-- 显示字体内容 

在 Netscape 中使用 TTF 字体。 

启动 netscape,打开属性设置 Edit->Preferences... 在 Appearance(外观)中选择 Fonts(字体)。 

For the Encoding: 选择 Simplified Chinese (gb 2312-80) 
Variable Width Font(变宽字体): 选择 Simsum (Misc) 
Allow Scaling (允许缩放)选中 

再次启动 Netscape 使改动生效。 

PS.如有任何错误请网友赶快提出,避免误导他人。Thank you!