Fonts FAQ

From ArchWiki
Revision as of 10:42, 7 April 2006 by Sebcactus (talk | contribs) (Q. The default font antialiasing seems to be too blurry and it hurts my eyes.)
Jump to: navigation, search

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Fonts FAQ#)

Q. The default font antialiasing seems to be too blurry and it hurts my eyes.

A. Be careful. Unless you removed old versions of Freetype, they may still be on there. Generally, they won't cause problems though as long as you have your symbolic links set properly. Here are some examples.

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*

As you can see, all files named "libfreetype.so*" point to the newest version, which, on my system, is currently libfreetype.so.6.3.3.

Be sure to check /usr/lib also. Some systems have Freetype libs installed there too. Generally, you can link them to your files in /usr/X11R6/lib instead. I have heard that FreeType is now an X component by default, and thus should be installed in /usr/X11R6/lib (as noted above) instead.

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. My fonts are too large or too small. The resolution seems wrong. My fonts are mis-shapen.

A(1). Get your proper from a console, by typing:

xdpyinfo | grep resolution

Display pixels should be square, if not it can cause errors in the alignment of vector and raster. The best way to proper fonts DPI is by setting DisplaySize in /etc/X11/xorg.conf. For my Samsung SyncMaster 172x LCD display which is 337.92mm width and 270.336mm heigh, I have:

Section "Monitor"
:
DisplaySize 338 270
:
EndSection

You can check your display dimensions in product manual or searching the internet. After changing that you should check again:

xdpyinfo | grep resolution

If it's OK ( square ) restart X and be happy. If not try increasing/decreasing the DisplaySize values to set square DPI. For SyncMaster 172x and 1280x1024 resolution I have 96dpi.

$ xdpyinfo | grep resolution
resolution:    96x96 dots per inch

This link could help: Fixing Font




A(2). 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.

Change the following line:

defaultserverargs=""

to...

defaultserverargs="-dpi 75"

Q. How do I install fonts?

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. The fonts in OpenOffice.org look very bad.

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. The OpenOffice.org menu font looks really bad. It doesn't use antialiasing either.

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 doesn't detect my TrueType fonts!

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. My menu fonts in OpenOffice.org have blank lines instead of text

Q. Mozilla and other programs can no longer access TrueType fonts on my system, and are reverting to ugly fonts instead.

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. What are some suggested font settings for Mozilla/Firefox?

A. These are recommended for Firefox:

Proportional: Serif   Size (pixels): 16
Serif: Times New Roman
Sans-serif: Arial
Monospace: Courier New   Size (pixels): 13
Display resolution: System settings
  • Note: Times New Roman may appear to be a non-TTF font. If this is the case, read above about how to fix this.

I believe that the following are Dropline's Mozilla defaults (also recommended):

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