Main - X
Fonts On X
"Anyone Seen My Loupe?"
Covers:
Why Do Look Fonts So Ugly?
My Fonts Are Too Small!
Adding Fonts
Font Viewers
Font Resources
Related Resources:
X Window User HOWTO, 7
Font Deuglification mini-HOWTO
man xfs
Translations:
Dec. 12, 1999
Tom Berger
|
By default, X only supports bitmapped fonts, while are not scaleable. If you scale
them anyway, they will look crumbly and rugged. This bipmapping is one reason
why X eats up so much memory: instead of vectorial descriptions it sends bitmaps
(i.e. small pictures of each displayed character).
Later there came support for PostScript Type 1 and Speedo fonts which are
scaleable, but the Type 1 font rendering machine is mediocre at best. Furthermore
are good Postscript® fonts very expensive and therefore can't be included.
There are a lot of free fonts but their quality doesn't match commercial ones.
(Thanks to Gael and Pablo for correcting me about this.)
Now X supports TrueType® fonts via the X Font Server 'xfs', but isn't
able to do nifty stuff like anti-aliasing yet (some window managers however
- like Enlightenment - do. The results
are not very convincing, though). Many X applications don't
know about TrueType® at all. 'Hinting' works differently than with
PostScript® so that even if the application allows using TT fonts, the
results could differ widely from what you might have expected. Hopefully
this problem will lessen as soon as XFree 4 will be released (expected
around February 2000), which will feature a major reimplantation of the font rendering
subsystem. Until then, one has to resort to shifts for the most serious problems.
The Xconfigurator might still prefer 75dpi (dots per inch) to 100dpi fonts
in /etc/X11/fs/config . If you have an entry there like
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
then that's the source of your problem. This entry defines the order in which
font directories are queried. This will lead to incredibly tiny fonts on most
modern monitors, which follow the MS-Windows® specification of 96dpi. This
is why many web pages come with itsy-bitsy sized fonts: They have been created
on MS-Windows, where fonts look larger.
(Offtopic: There is no problem with using MS-apps, but if you make pages for a
multi-platform readership, make sure they can actually read your pages without
changing Netscape's font settings). Fix (thanks to Richard Lamont for
correcting me about the xfs restart command):
Check if you have the 100dpi-fonts package installed (rpm -qa |
grep 100 ).
-
Open
/etc/X11/fs/config in an editor as root and switch
the entries
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
to
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
-
(Optional) Change
# 100 x 100 and 75 x 75
default-resolutions = 75,75,100,100
to
# 100 x 100 and 75 x 75
default-resolutions = 100,100,75,75
and save the file.
-
Restart the X Font Server by issuing this command as root:
kill -SIGUSR1 $(pidof xfs)
-
Restart X. Enjoy ;-).
Note: A growing amount of apps allow setting font size and family, for
instance most KDE-apps and Netscape (via
'edit-preferences-appearance-fonts').
PostScript® (*.pcf)
-
As root, create a new directory for your fonts in
'/usr/X11R6/lib/X11/fonts' and put your new fonts in there.
-
Run
mkfontdir /usr/X11R6/lib/X11/fonts/[new directory] .
This creates the new files 'fonts.alias' and 'fonts.dir'.
-
Run
/usr/sbin/chkfontpath --add [directory]
-
Run
xset fp rehash . Ready.
TrueType® (*.ttf)
(thanks to yants for helping me with this one!)
-
Create a new directory for the fonts you want to add (like
md /usr/X11R6/lib/X11/fonts/my_ttf .)
This is necessary because some of the fonts in 'ttfonts' are broken and would lead to a corrupt fonts.dir file if
processed with 'ttmkfdir' and 'mkfontdir'.
-
Put your fonts into this new directory. Make sure their file names consist only of small-letters.
-
Run
ttmkfdir > fonts.scale to create a fonts.scale file to be processed by 'mkfontdir'.
-
If you get errors such as unknown encodings those fonts won't get added to the fonts.scale or fonts.dir
files and hence will not be accessible. To make those fonts available try running
ttmkfdir -c -p > fonts.scale You'll still get the errors but your fonts should get added to
the fonts.scale file.
-
Run
mkfontdir .
-
Run
chkfontpath --add /usr/X11R6/lib/X11/fonts/my_ttf to add this directory to your font
path.
-
Run
xset fp rehash to make sure that X recognizes the new fonts.
Someone asked me if it were possible to use font directories which reside
on other filesystems (e.g. on a Windows partition). That shouldn't be a
problem, as long as you tell Linux via /etc/fstab to mount
that partition each time you boot (you can do this with 'linuxconf': choose
'File systems - Access local drives - Add'). Of course you have to add the path
to that directory to /etc/X11/fs/config, too. I've been told that Linux-Mandrake 6.1
should detect and configure font-directories on partitions mounted on boot all
by itself. Haven't tested it yet though.
TrueType's 'Great
TrueType Fonts' page lists all major resources for TT fonts.
Please pay attention to copyright issues, many of these fonts may not be
redistributable!
Fonts from the RPM repository
at Rufus.Org in RPM-Format.
Shareware Typefaces is a large, searchable collection of freeware and shareware fonts.
The fonts page of GIMP.org lists some packages
useful for using with GIMP. If you've ever encountered those annoying script-fu errors because
of missing fonts, this is the place to go!.
|