歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> Redhat6.2中文TrueType字體使用

Redhat6.2中文TrueType字體使用

日期:2017/2/27 9:41:08   编辑:更多Linux
  上次在《RedHat 6.2 中文顯示與輸入的設置》中提到中文TrueType字體的使用時,否認了 XFree86 3.3.6 對中文 TTF 字體的支持能力,實在不好意思,其實該版 X 視窗系統對此已具備了能力。以下是使用步聚: 建立字體存放目錄,如: $ 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 ====== 1 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 使改動生效。


[1]



Copyright © Linux教程網 All Rights Reserved