Font Management In Linux, Part 2

By: Carla Schroder
Thursday, October 25, 2007 09:36:33 AM EST
URL: http://www.linuxplanet.com/linuxplanet/tutorials/6431/1/

Previewing Fonts

Last week we learned some useful tips about font management in Linux. Today we're going to learn a few more ways to preview fonts, how to view font character maps, how to manage console fonts, and how to design your own fonts.

Alert reader Terry H. informed me that another font previewer has been born: GNOME-Specimen. It's just a baby, first released in November 2006, and is now at version 0.3.1. Debian users will find it in the Lenny and Sid repositories. Fedora 6 users will find it in the Extras repository. Fedora 7 and 8 merged Core and Extras, so they don't have a separate Extras repository anymore. It has a nice interface that lets you select and compare different fonts side-by-side, though you can't install or remove fonts, or print samples.

Terry also pointed out that Nautilus has two different ways of previewing fonts, and that it will preview all font formats. One way is to navigate to a fonts directory, like /usr/share/fonts/default/type1, and click on the .pfb files. An easier way is to type fonts:/// in the Location bar; this displays all of your installed fonts. Another way to get to this window is via System -> Preferences -> Fonts. Click the "details" button, then "go to the font folder."

gucharmap, the GNOME Character Map, is pleasingly-readable and displays both complete tables of character sets, and information on individual characters. You may also place characters on the Clipboard to paste into documents. When you see hexadecimal characters (like 15-0C or 14-0F) in the character table that means that no glyph exists at that location in the table. (Of course gucharmap works in any desktop or window manager, not just GNOME.)

Command-line commandos can use xlsfonts to list all available fonts:

$ xlsfonts
[...]
-bitstream-bitstream vera sans mono-medium-r-normal--0-0-0-0-m-0-iso8859-9
-bitstream-bitstream vera sans-bold-o-normal--0-0-0-0-p-0-iso10646-1
[...]
Then use xfd ("X font display") to display a character map:
$ xfd -fn '-bitstream-bitstream vera sans mono-medium-r-normal--0-0-0-0-m-0-iso8859-9'

Finding and Installing New Fonts

Check your distribution's software repositories first. On Debian and its many descendants you can install new fonts the usual way, with aptitude or Synaptic. Fedora users have Yum and the nice graphical Package Manager. Other Linuxes- you get the idea.

If that doesn't satisfy your font desires, there are a number of sites with nice free Linux fonts. The Linux Libertine font set is designed as a quality Times and Times New Roman replacement. These are both free of cost and licensed under the GPL. Installation is easy: download and unpack the tarball, and then move the LinLibertineFont/ directory into any of the directories listed in /etc/fonts/fonts.conf. Your new Libertine fonts should be instantly available.

Check out these sites for a bit of font-shopping:

Console Fonts

I'm talking the Real Linux Console here, the one you get to with Ctrl+Alt+F1. No sissy X terminal, no, but the real deal with no X windows of any kind. On Debian console fonts are stored as compressed files in /usr/share/consolefonts. Fedora puts them in /lib/kbd/console/fonts.

To change the console font, Fedora users need to edit /etc/sysconfig/i18n. The default console font is latarcyreb-sun16. You can change this to any of the fonts in /lib/kbd/console/fonts.

On Debian, look for /etc/console-tools/config, and enter any font that is present in /usr/share/consolefonts.

Ubuntu users must change /etc/default/console-setup. The file itself tells you what variables you can use. Always leave CHARMAP="UTF-8" alone; you always want Unicode. CODESET, FONTFACE, and FONTSIZE adjust your fonts.

The new fonts will appear as soon as you log into to a new console, so hit Ctrl+Alt+F1, or any F-key up to F6, and log in to try it out. Alt+Fn switches you between consoles, and Alt+F7 takes you back to X Window.

FontForge

FontForge is an interesting font viewing, editing, and creation application. Its interface is rather rickety-looking; tiny jaggedy non-resizable fonts, and no configuration options such as default font directories or themes. It starts in your home directory whether you want it to or not.

But underneath the plain face is a power tool for creating fonts in all formats, and for converting fonts into different formats. Linux supports a wide range of font formats, but if you ever need to make a conversion this is the tool to use. The documentation is extensive and available in several languages. It even supports Wacom tablets. The Libertine fonts were created with FontForge. Designing fonts is a difficult and time-consuming task, but who knows, you may find you have a talent for it.

Resources

The Anatomy of Web Fonts
A Quick Primer On Unicode and Software Internationalization Under Linux and UNIX
Unicode Font Guide For Free/Libre Open Source Operating Systems

Copyright Jupitermedia Corp. All Rights Reserved.