This is an incomplete HOWTO about dfontmgr.
As a new Linux user I was rather confused by how to properly install fonts, so I was happy to discover a GUI application, dfontmgr, that acts as a user-friendly(ish) interface for defoma, the Debian Font Manager. I've written some instructions on how to install and use dfontmgr, but I could use some help from the experts to complete this "HOWTO". (More on that later.)
Anyway, here's how to use dfontmgr to install fonts:
First, install (or upgrade) the following packages, using your favorite "apt"-type software (aptitude, apt-get, Synaptic, etc.) with "sudo" or logged in as root:
defoma [Debian Font Manager, installed by default with Ubuntu, but you may wish to upgrade]
defoma-doc [puts doc files in /usr/share/doc/defoma-doc/]
dfontmgr [from "universe" -- graphical interface to defoma]
psfontmgr [from "universe" -- needed if you're planning to add Postscript fonts (I haven't tested this)]
Create a directory /usr/share/fonts/truetype/custom/ (or whatever name you like) and copy your .ttf (TrueType) font files into it. (Postscript Type 1 fonts should probably go in /usr/share/fonts/type1/custom/, but I haven't tried installing any yet myself.)
Start up dfontmgr (as root or with "sudo"), click on "Register Font", and use the file selector to navigate to /usr/share/fonts/truetype/custom/ and select a font to register. (Dragging-and-dropping is supposed to work here, but it's buggy: if it works at all, it produces a font filename with extra slashes in front, so I don't recommend using it.)
(You'll probably find it helpful to also open the font with the Gnome Font Viewer, so you can see what you're installing and verify that your font file is readable. Just double-click the font from the Nautilus file manager.)
The dfontmgr font registration wizard will try to identify what category the font is (e.g., TrueType, Type 1, etc). For fonts it can't identify (which seems to be all of them!) you can select the appropriate category manually. Next, the hints generator will lead you through creating hints file information (Family, Subfamily, FontName, Foundry, Location, Charset, GeneralFamily, Weight, Width, Shape(s), Alias(es), and Priority).
Note that "hints files" have NOTHING to do with the "hinting" or "autohint" features used in font rendering, so don't let the similar name confuse you. For more details about hints, open up the following link in your browser (this is one of the help files installed by the defoma-doc package):
file:///usr/share/doc/defoma-doc/developers.html/ch1.html
This process is not nearly as intimidating as it appears, because dfontmgr proposes reasonable default choices for most of the hints, so you can just keep clicking "Next" if they look satisfactory. The "Family" and "Shape" hints need some extra instructions:
If dfontmgr discovers that your font's "Family" name contains blanks, it will replace the blanks with dots (e.g., "Maiandra GD" becomes "Maiandra.GD"). This may be technically okay but it will confuse OpenOffice.org and you'll see two versions of each font name in the font selector. Use hyphens instead (like this: "Maiandra-GD"). The easiest way to do this is to accept the default name (with dots), and edit it later (see below).
The "Shape" entry is a bit confusing. You can select more than one value here. Typically you'd want to select either Serif or NoSerif, AND ALSO either Upright or Oblique or Italic to indicate the amount of slant. You can also add Condensed or Expanded for fonts that are squeezed or stretched in the horizontal dimension.
After the hints generator has finished prompting you for all the hints file information, you'll have an opportunity to hand-edit the file before it becomes "official". (This is the time to fix the "Family" name if it contains dots: replace the dots with hyphens.) If you mess up, you can always click "Change Hints" to fix things.
That's all! Repeat "Register Font" for all your other new fonts.
Okay, what's the point of going through all this, rather than just dropping the font files in an existing font directory and waiting for them to be automatically found?
This is where I could use some expert assistance with this HOWTO. I only have a vague understanding of why I should install fonts this way. I think it ought to make the fonts available to more applications. Can someone please contribute a better explanation?
I also thought that some of the hints file data could make the fonts more useful. For example, I noticed that one of the available hints is "Transform", which is supposed to control whether the font can be transformed into slanted and/or bold forms. AHA! Does this mean we can take a font like Kristen ITC, which only has a regular version (no bold or italic), and automatically generate slanted or boldized forms of it? Unfortunately, adding "Transform = Slant Boldize" to the hints file seems to have no effect (at least, not in OpenOffice.org 1.1.3).
So I'd also appreciate some expert advice on how to make best use of the hints files.
Thanks in advance to anyone who helps to complete this HOWTO!
Bookmarks