Fonts 常見問答集

From ArchWiki

Jump to: navigation, search
Image:Tango-emblem-important.png The factual accuracy of this article is disputed.
Please help improve the article and verify/correct/remove disputed content. (Discuss)
Image:Tango-preferences-desktop-locale.png This page was marked to be translated.
If you understand both "original" and "target" languages of this page, please help complete the translation.
i18n
English
繁體中文

Contents

Q. 系統預設的反鋸齒字型看起來非常模糊,真傷眼睛。

A. 請注意,除非你把舊版本的 Freetype 先移除了,不然他們可能會繼續留在系統內。一般來說,如果你的 symbolic links 有正確的設定,就算系統內保留了舊版本的 Freetype 也不會造成什麼影響。下面是一些例子。

user@darkstar:/usr/X11R6/lib$ ls -l /usr/X11R6/lib/libfreetype.so*
lrwxrwxrwx    1 root     root           20 Apr  9 23:10 /usr/X11R6/lib/libfreetype.so -> libfreetype.so.6.3.3*
lrwxrwxrwx    1 root     root           20 Apr  9 23:10 /usr/X11R6/lib/libfreetype.so.6 -> libfreetype.so.6.3.3*
-rwxr-xr-x    1 root     root      1407204 Apr  9 23:10 /usr/X11R6/lib/libfreetype.so.6.3.3*

你可以看到,所有命名為 "libfreetype.so*" 的檔案都指向最新版本的 FreeType,在上面的例子內,他們都指向 libfreetype.so.6.3.3。

請記得順便檢查一下 /usr/lib 這個目錄。有些系統會把 Freetype 的程式庫安裝到那邊去。一般來說,你可以用 link 的方式把他們連接到你在 /usr/X11R6/lib 這個目錄下的檔案。我聽說,在預設的狀況下,目前 FreeType 已經被列為 X 內的一個元件,所以他們應該都被安裝到 /usr/X11R6/lib (就像上面所說的) 這個目錄內才對。

user@darkstar:/usr/lib$ ls -l /usr/lib/libfreetype.so*
lrwxrwxrwx    1 root     root           35 Apr  9 23:01 /usr/lib/libfreetype.so
-> /usr/X11R6/lib/libfreetype.so.6.3.3*
lrwxrwxrwx    1 root     root           35 Apr  9 23:01 /usr/lib/libfreetype.so.6 -> /usr/X11R6/lib/libfreetype.so.6.3.3*
lrwxrwxrwx    1 root     root           31 Apr  6 23:21 /usr/lib/libfreetype.so.6.3.1 -> /usr/X11R6/lib/libfreetype.so.6*
lrwxrwxrwx    1 root     root           31 Apr  6 23:21 /usr/lib/libfreetype.so.6.3.3 -> /usr/X11R6/lib/libfreetype.so.6*

Q. 我的字型看起來太大了(或是太小了)。解析度好像設定錯了。我的字型看起來很奇怪 (mis-shapen).

A. Get your proper resolution from a console, by typing:

xdpyinfo | grep resolution

Change the value to this in the Gnome font configurator. Restart X. Sometimes, the videocard gives bogus information to X. It may be better to settle on a value between 72-78 DPI for 1024x768 displays. 96 DPI is a good value for 1280x1024, but it depends on the exact resolution. I actually prefer 75 on my home machine, and the font sizes seem to be a bit more true to their proper sizes when this is set. In most cases, if the numbers don't match, you may use the following method.

You may also opt to force X to start with a forced resolution. This may produce good results in some display modes. For example, you may use:

startx -- -dpi 75

This will force X to start in 75x75 DPI mode. You may change your Gnome font settings (From the menu: Applications/Desktop Preferences/Font) to 75 DPI and you should get a good match.

If this worked well for you, you may edit your "startx" script to always force this option on startup. Edit the file "/usr/X11R6/bin/startx" as root.

將下面這一行:

defaultserverargs=""

更改為...

defaultserverargs="-dpi 75"

Q. 我該如何安裝新的字型?

A. An easy way to install fonts is to drop them into your "$HOME/.fonts" directory and running "fc-cache". You can also perform a system-wide font installation by copying the fonts to "/usr/share/fonts" or another font directory (as long as it is listed in your "/etc/fonts/fonts.conf" file), and then performing the "fc-cache" command as root. You may also need to run "ttmkfdir" or "mkfontdir" as well.

Q. 在 OpenOffice.org 內顯示的字型看起來非常差。

A. By default, OpenOffice.org for Linux ships with inferior LibFreetype libraries that are built directly into the code. You can force it to link to the latest version of your LibFreetype libraries adding this line to your "$HOME/OpenOffice.org/soffice" script. I put mine at the top of the file. You may need to do this as root, since the file is symlinked to the OpenOffice.org install directory. (For example, mine is located in /opt/OpenOffice.org644/program/soffice).

export LD_PRELOAD=/usr/X11R6/lib/libfreetype.so

Then run the "soffice" script and it should now use your system's Freetype libaries.

Q. OpenOffice.org 選單上的字型看起來真醜。他也無法使用反鋸齒字型的設定。

A. This can be changed in the OpenOffice.org configurator. From the drop-down menu, select "Tools/Options/OpenOffice.org/Fonts". Check the box that says "Apply Replacement Table". Type "Andale Sans UI" in the font box and choose your desired font for the "Replace With" option. Dropline users may prefer the system default, "Trebuchet MS". When selected, click the checkmark box. Then choose the "always" and "screen" options in the box below. Apply the changes, and your menu fonts should look great.


Q. OpenOffice.org 無法使用系統內安裝好的 TrueType 字型!

A. Make sure that you add the appropriate entry in your /etc/X11/XF86Config file that points your programs to the /usr/share/fonts/ directory.

For example, here's my XF86Config file...

Section "Files"
RgbPath      "/usr/X11R6/lib/X11/rgb"
ModulePath   "/usr/X11R6/lib/modules"
FontPath     "/usr/share/fonts/"
FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
FontPath     "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath     "/usr/X11R6/lib/X11/fonts/CID/"
FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection

Note the FontPaths listed above. /usr/share/fonts/ is not included in the file by default. You may also need to try some of the solutions in the next section to replace the fonts.dir and fonts.scale files if this doesn't work.

Another solution is to run the openoffice administration tool

# /opt/openoffice/spadmin

from which you can add fonts.

Q. 在 OpenOffice.org 的選單上的字型無法正確顯示,只出現一堆空白

Q. Mozilla 和一些其他程式忽然無法讀取我的系統內安裝好的 TrueType 字型,所有的顯示又變回又醜又怪的字型了。

A. Make sure the "freetype" module is loaded in your /etc/X11/XF86Config file and your /usr/X11R6/lib/fonts/TTF/fonts.dir lists all of the TrueType fonts you have installed.

Try checking your "Files" section of your XF86Config, and make sure that you have all (or most) of these directories listed.

Section "Files"
RgbPath      "/usr/X11R6/lib/X11/rgb"
ModulePath   "/usr/X11R6/lib/modules"
FontPath     "/usr/share/fonts/"
FontPath     "/usr/X11R6/lib/X11/fonts/misc/"
FontPath     "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath     "/usr/X11R6/lib/X11/fonts/CID/"
FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection

Finally, go to the following font directories:

/usr/X11R6/lib/fonts/TTF
/usr/share/fonts

Try deleting the "fonts.dir" and "fonts.scale" files in these directories. You may want to make backups first though. Run these commands to replace them.

/usr/X11R6/bin/mkfontscale
/usr/X11R6/bin/mkfontdir

On most systems, "/usr/share/fonts" will by symlinked to "/usr/X11R6/lib/fonts/TTF, so you may only need to do this in one of the directories.

The "mkfontdir" and "mkfontscale" utilities should be used on Xfree86 4.3.0 based setups while on older ones (4.2.x) "ttmkfdir" should be considered. I've noticed that "ttmkfdir" and "mkfontdir" do not produce the exact same files. Upon having "mkfontdir" fail at creating a proper "fonts.scale" and fonts.dir file, If you happen to have both programs, and "mkfontdir" fails, try this instead in the following directories:

/usr/X11R6/lib/fonts/TTF
/usr/share/fonts
ttmkfdir -o fonts.scale
cp fonts.scale fonts.dir

After running these, restart your machine and see if the fonts are now working properly. Remember that both directories may be symlinked, so you may not need to repeat the step a second time.

Q. 在 Mozilla/Firefox 內,你建議使用哪種字型和哪些設定呢 ?

A. 下面這是在 Firefox 內建議使用的設定:

Proportional: Serif   Size (pixels): 16
Serif: Times New Roman
Sans-serif: Arial
Monospace: Courier New   Size (pixels): 13
Display resolution: System settings

我想,下面這是 Dropline 包裝的 Mozilla 套件的預設值 (建議你也可參考這個設定):

Proportional: Serif   Size (pixels): 14
Serif: Times New Roman
Sans-serif: Verdana
Cursive: Andale Mono
Fantasy: Andale Mono
Monospace: Courier New   Size (pixels): 11
Allow Documents to use other fonts: Enabled
Display resolution: System settings

在其他非英文的環境下,我也建議使用上面關於英文的設定。但是在 fonts.conf 的設定內,把要使用的中文字形放在英文字型後(也就是第二順位)。這樣一來可以改善英文字型的顯示效果。

更多關於中文環境下的設定請參考 i18n 的相關教學文章。

Personal tools