Font HOWTO Donovan Rebbechi, elflord@panix.com Revision History Revision v2.0 2002-07-10 Revised by: dr Provides a comprehensive source to act as a starting point for any and all font questions about Linux. ----------------------------------------------------------------------------- Table of Contents 1. Introduction 1.1. The Location of This Document 1.2. Submitting corrections/errata 1.3. Last Updated 1.4. Copyright 1.5. Rationale 1.6. Credits and Acknowledgements 2. Fonts 101 -- A Quick Introduction to Fonts 2.1. Types of Fonts 2.2. Families of Typefaces 3. Fonts 102 -- Typography 3.1. Classifications of Typefaces 3.2. Ligatures, Small caps fonts and expert fonts 3.3. Font Metrics and Shapes 4. Making Fonts Available To X 4.1. The font path 4.2. Installing Type 1 Fonts 4.3. True Type Fonts 4.4. xfs 5. Making Fonts Available To Ghostscript 5.1. Type 1 5.2. True Type 5.3. Using Ghostscript To Preview Fonts 6. True Type to Type 1 Conversion 6.1. Why ? 6.2. How ? 7. WYSIWYG Publishing and Fonts 7.1. Introduction and Overview 7.2. Applixware 7.3. Star Office 7.4. Word Perfect 8. Netscape 9. TeX / LaTeX 9.1. A Quick Primer on LaTeX/TeX fonts 9.2. Adding Type 1 fonts 10. Getting Fonts For Linux 10.1. True Type 10.2. Type 1 Fonts and Metafont 11. Useful Font Software for Linux 12. Ethics and Licensing Issues Related to Type 13. References 13.1. Font Information 13.2. Postscript and Printing Information 14. Glossary 1. Introduction 1.1. The Location of This Document This document is located at [http://pegasus.rutgers.edu/~elflord/font_howto] my webpage ----------------------------------------------------------------------------- 1.2. Submitting corrections/errata Please don't send me html ! I con't do anything with it. Instead, send a patch based on the sgml source. To do this, edit Font-HOWTO.sgml, save the new file to Font-HOWTO.sgml.new, and run the diff program: +---------------------------------------------------------------------------+ |diff -u Font-HOWTO.sgml Font-HOWTO.sgml.new | +---------------------------------------------------------------------------+ and send me the patch. If I like it, it's easy for me to add it immediately. It's also easy for me to quickly inspect the changes and decide whether or not I like them. ----------------------------------------------------------------------------- 1.3. Last Updated This version is last updated Wed Jul 10 20:05:15 EDT 2002. Go to the location of the document for the latest version. ----------------------------------------------------------------------------- 1.4. Copyright Copyright (c) 2000-2002 by Donovan Rebbechi Please freely copy and distribute (sell or give away) this document in any format. It's requested that corrections and/or comments be forwarded to the document maintainer, but you are not obliged to. You may create a derivative work and distribute it provided that you:   * Send your derivative work (in the most suitable format such as sgml) to the LDP (Linux Documentation Project) or the like for posting on the Internet. If not the LDP, then let the LDP know where it is available.   * License the derivative work with the same license as this one or use GPL. Include a copyright notice and at least a pointer to the license used.   * Give due credit to previous authors and major contributors. If you're considering making a derived work other than a translation, it's requested that you discuss your plans with the current maintainer. ----------------------------------------------------------------------------- 1.5. Rationale I'm going to make this brief (-; The purpose of this document is to address what was a gaping hole in font documentation. While previously, there were several documents about fonts for Linux, I felt that none of them were comprehensive, all of them had a relatively narrow focus. Hence the goal of this document is not to provide radical new insight into the issue of font handling ( though I have included material previously unavailable ), the main aim is to provide a comprehensive source to act as a starting point for any and all font questions about Linux. ----------------------------------------------------------------------------- 1.6. Credits and Acknowledgements Special thanks are due to Rod Smith, who made several helpful suggestions, and fixed pfm2afm. Also thanks to Doug Holland, whose Font Deuglification HOWTO proved to be a good reference, John McLaughlin, author of the document that helped me come to grips with Star Office, and the Linux community for their suggestions and constructive comments. ----------------------------------------------------------------------------- 2. Fonts 101 -- A Quick Introduction to Fonts 2.1. Types of Fonts 2.1.1. Bitmap Fonts A bitmap is a matrix of dots. Bitmap fonts are represented in precisely this way -- as matrices of dots. Because of this, they are device dependent -- they are only useful at a particular resolution. A 75 DPI screen bitmap font is still 75 DPI on your 1200 DPI printer. There are two types of bitmap fonts -- bitmap printer fonts, such as the pk fonts generated by dvips, and bitmap screen fonts, used by X and the console. The bitmap screen fonts typically have a bdf or pcf extension. Bitmap screen fonts are most useful for terminal windows, consoles and text editors, where the lack of scalability and the fact that they are unprintable is not an issue. ----------------------------------------------------------------------------- 2.1.2. Type 1 Fonts The Type 1 font standard was devised by Adobe, and Type 1 fonts are supported by Adobe's PostScript standard. Because of this, they are also well supported under linux. They are supported by X and ghostscript. Postscript fonts have traditionally been the choice of font for anything on UNIX that involves printing. Typically, a UNIX Type 1 font is distributed as an afm ( adobe font metric ) file, and an outline file, which is usually a pfb ( printer font binary ) or pfa ( printer font ascii ) file. The outline file contains all the glyphs, while the metric file contains the metrics. Type 1 fonts for other platforms may be distributed in different formats. For example, PostScript fonts for windows often use a different format ( pfm ) for the metric file. ----------------------------------------------------------------------------- 2.1.3. Type3 Fonts These fonts are distributed in a similar manner to Type 1 files -- in groups of afm font metrics, and pfa files. While they are supported by the PostScript standard, they are not supported by X, and hence have limited use. ----------------------------------------------------------------------------- 2.1.4. TrueType Fonts TrueType fonts were developed by Apple. They made the format available to Microsoft, and succesfully challenged Adobe's grip on the font market. True type fonts store the metric and shape information in a single file ( usually one with a ttf extension ). Recently, font servers have been developed that make TrueType available to X. And PostScript and ghostscript have supported TrueType fonts for some time. Because of this, TrueType fonts are becoming more popular on linux. ----------------------------------------------------------------------------- 2.1.5. Type 42 Fonts Type42 fonts are actually just TrueType fonts with headers that enable them to be rendered by a PostScript interpreter. Most applications, such as ghostscript and SAMBA handle these fonts transparently. However, if you have a PostScript printer, it may be necessary to explicitly create Type42 font files. ----------------------------------------------------------------------------- 2.1.6. Type 1 vs TrueType -- a comparison Despite the historical feuding between the proponents to Type 1 and TrueType fonts, both have a lot in common. Both are scalable outline fonts. Type 1 fonts use cubic as opposed to quadratic curves for the glyphs. This is in theory at least a slight advantage since they include all the curves available to TrueType fonts. In practice, it makes very little difference. TrueType fonts have the apparent advantage that their support for hinting is better ( Type 1 fonts do have hinting functionality, but it is not as extensive as that of TrueType fonts ). However, this is only an issue on low resolution devices, such as screens ( the improved hinting makes no discernable difference on a 600dpi printer, even at small point sizes. ) The other point that makes this apparent advantage somewhat questionable is the fact that well hinted TrueType fonts are rare. This is because software packages that support hinting functionality are out of the budget of most small time designers. Only a few major foundries, such as Monotype make well hinted fonts available. In conclusion, the main differences between TrueType and Type 1 fonts are in availability and application support. The widespread availability of TrueType fonts for Windows has resulted in webpages designed with the assumption that certain TrueType fonts are available. Also, many users have large numbers of TrueType fonts because they ship with the users Windows applications. However, on Linux, most applications support Type 1 fonts but do not have the same level of support for TrueType. Moreover, most major font foundries still ship most of their fonts in Type 1 format. For example, Adobe ships very few TrueType fonts. My recommendation to users is to use whatever works for your application, and try to avoid converting from one format to another where possible ( because the format conversion is not without loss ). ----------------------------------------------------------------------------- 2.1.7. Metafont Metafont was developed by Donald E. Knuth as part of the TeX typesetting system. Metafont is a graphics programming language ( like PostScript ) that has applications wider than just fonts. Metafonts exhibit some very desirable qualities. One of the important features is that metafonts can scale very gracefully. The metafont Computer Modern has different shape at 20 point and 10 point. The shape changes with size, because it is desirable for a smaller font to be proportionately wider than a larger font ( this makes the larger fonts more elegant and the smaller fonts more readable ). Metafonts typically have a mf extension. They are rendered to device dependent bitmap fonts. The rendering is slow, so they are of excellent quality, but are not well suited to WYSIWYG publishing. ----------------------------------------------------------------------------- 2.2. Families of Typefaces Typically, typefaces come in groups of a few variants. For example, most fonts come with a bold, italic, and bold-italic variant. Some fonts may also have small caps, and demibold variants. A group of fonts consisting of a font and its variants is called a family of typefaces. For example, the Garamond family consists of Garamond, Garamond-italic, Garamond-bold, Garamond bold-italic, Garamond demi-bold, and Garamond demi-bold-italic. The Adobe expert Garamond font also makes available Garamond small caps, and Garamond titling capitals. ----------------------------------------------------------------------------- 3. Fonts 102 -- Typography Here, we discuss some typography basics. While this information is not essential, many font lovers will find it interesting. ----------------------------------------------------------------------------- 3.1. Classifications of Typefaces 3.1.1. Fixed versus variable width There are several classifications of typefaces. Firstly, there are fixed width fonts, and variable width fonts. The fixed width fonts look like typewriter text, because each character is the same width. This quality is desirable for something like a text editor or a computer console, but not desirable for the body text of a long document. The other class is variable width. Most of the fonts you will use are variable width, though fixed width can be useful also ( for example, all the example shell commands in this document are illustrated with a fixed width font ). The most well known fixed width font is Courier. ----------------------------------------------------------------------------- 3.1.2. To serif or not to serif ? Serifs are little hooks on the ends of characters. For example, the letter i in a font such as Times Roman has serifs protruding from the base of the i and the head of the i. Serif fonts are usually considered more readable than fonts without serifs. There are many different types of serif fonts. Sans serif fonts do not have these little hooks, so they have a starker appearance. One usually does not write a long book using a sans serif font for the body text. There are sans serif fonts that are readable enough to be well suited to documents that are supposed to be browsed / skimmed ( web pages, catalogues, marketing brochures ). Another application that sans serif fonts have is as display fonts on computer screens, especially at small sizes. The lack of detail in the font can provide it with more clarity. For example, Microsoft touts Verdana as being readable at very small sizes on screen. Notable sans serif fonts include Lucida Sans, MS Comic Sans, Verdana, Myriad, Avant Garde, Arial, Century Gothic and Helvetica. By the way, Helvetica is considered harmful by typographers. It is somewhat overused, and many books by typographers plead users to stay away from it. ----------------------------------------------------------------------------- 3.1.3. The old and the new -- different types of Serif fonts 3.1.3.1. Old Style Old style fonts are based on very traditional styles dating as far back as the late 15th century. Old style fonts tend to be conservative in design, and very readable. They are well suited to writing long documents. The name ``old style'' refers to the style of the font, as opposed to the date of its design. There are classic old style fonts, such as Goudy Old Style, which were designed in the 20th century. The old style class of fonts has the following distinguishing features:   * Well defined, shapely serifs.   * Diagonal emphasis. Imagine drawing a font with a fountain pen, where lines 45 degrees anticlockwise from vertical are heavy and lines 45 degrees clockwise from vertical are light. Old style fonts often have this appearance.   * Readability. Old style fonts are almost always very readable.   * Subtlety and lack of contrast. The old style fonts have heavy lines and light lines but the contrast in weight is subtle, not stark. Notable Old Style fonts include Garamond, Goudy Old Style, Jenson, and Caslon ( the latter is contentious -- some consider it transitional ) ----------------------------------------------------------------------------- 3.1.3.2. Moderns ( or didone ) The moderns are the opposite of old style fonts. These fonts typically have more character, and more attitude than their old style counterparts, and can be used to add character to a document rather than to typeset a long piece. However, nothing is black and white -- and there are some modern fonts such as computer modern and Monotype modern, and New Century Schoolbook which are very readable ( the contrast between heavy and light is softened to add readability ). They are based on the designs popular in the 19th century and later. Their distinguishing features include:   * Lighter serifs, often just thin horizontal lines.   * Vertical emphasis. Vertical lines are heavy, horizontal lines are light.   * Many moderns have a stark contrast between light and heavy strokes.   * Modern typefaces with high contrast between light and heavy strokes are not as readable as the old style fonts. Bodoni is the most notable modern. Other moderns include computer modern, and Monotype modern ( on which computer modern is based ). ----------------------------------------------------------------------------- 3.1.3.3. Transitional Transitional fonts fit somewhere in between moderns and old style fonts. Many of the transitionals have the same kind of readability as the old styles. However, they are based on slightly later design. While a move in the direction of the moderns may be visible in these fonts, they are still much more subtle than the moderns. Examples of transitionals include Times Roman, Utopia, Bulmer, and Baskerville. Of these, Times leans towards old style, while Bulmer looks very modern. ----------------------------------------------------------------------------- 3.1.3.4. Slab Serifs The slab serif fonts are so named because they have thick, block like serifs, as opposed to the smooth hooks of the old styles or the thin lines of some of the moderns. Slab serif fonts tend to be sturdy looking and are generally quite readable. Many of the slab serifs have Egyptian names -- such as Nile, and Egyptienne ( though they are not really in any way Egyptian ). These fonts are great for producing readable text that may suffer some dilution in quality ( such as photocopied documents, and documents printed on newspaper ). These fonts tend to look fairly sturdy. The most notable slab serif fonts are Clarendon, Memphis and Egyptienne, as well as several typewriter fonts. Many of the slab serif fonts are fixed width. Conversely, most ( almost all ) fixed width fonts are slab serif. ----------------------------------------------------------------------------- 3.1.4. The Sans Serif Revolution Surprisingly, the rise of sans serif fonts is a fairly recent phenomenon. The first well known sans serif fonts were designed in the 19th early 20th century. The earlier designs include Futura, Grotesque and Gill Sans. These fonts represent respectively the ``geometric'', ``grotesque'' and ``humanist'' classes of sans serif fonts. ----------------------------------------------------------------------------- 3.1.4.1. Grotesque The grotesques where so named because the public were initially somewhat shocked by their relatively stark design. Groteques are very bare in appearance due to the absence of serifs, and the simpler, cleaner designs. Because of their ``in your face'' appearance, grotesques are good for headlines. The more readable variations also work quite well for comic books, and marketing brochures, where the body text comes in small doses. Grotesques don't look as artsy as their geometric counterparts. Compared to the geometrics, they have more variation in weight, more strokes, they are squarer ( because they don't use such circular arcs ). They use a different upper case G and lower case a to the geometrics. While they are minimalistic but don't go to the same extreme as the brutally avant-garde geometrics. Notable grotesques include the overused Helvetica, Grotesque, Arial, Franklin Gothic, and Univers. ----------------------------------------------------------------------------- 3.1.4.2. Geometric The Futura font came with the manifesto: form follows function. The geometric class of fonts has a stark minimalistic appearance. Distinguishing features include a constant line thickness ( no weight ). This is particularly conspicuous in the bold variants of a font. Bold groteques and humanist fonts often show some notable variation in weight while this rarely happens with the geometric fonts. Also notable is the precise minimalism of these designs. The characters almost always are made up from straight horizontal and vertical lines, and arcs that are very circular ( to the point where they often look as though they were drawn with a compass ). The characters have a minimal number of strokes. This gives them a contemporary look in that they embrace the minimalistic philosophy that would later take the world of modern art by storm. A tell tale sign that a font is a geometric type is the upper case ``G'', which consists of a minimalistic combination of two strokes -- a long circular arc and a horizontal line. The other character that stands out is the lower case ``a'' -- which is again two simple strokes, a straight vertical line and a circle ( the other ``a'' character is more complex which is why it is not used ). Notable geometrics include Avant Garde, Futura, and Century Gothic. ----------------------------------------------------------------------------- 3.1.4.3. Humanist As the name might suggest, humanist fonts were designed with a goal of being less mechanical in appearance. In many ways, they are more similar to the serif fonts than the geometrics and the grotesques. They are said to have a ``pen drawn'' look about them. They tend to have subtle variation in weight, especially observable in bold variants. The curve shapes are considerably less rigid than those of the geometrics. Many of them are distinguishable by the ``double story'' lower case g, which is the same shape as the g used in the old style serif fonts. The humanist typefaces are the easiest to use without producing an ugly document as they are relatively compatible with the old style fonts. ----------------------------------------------------------------------------- 3.1.5. Compatible Typefaces Grouping typefaces is not easy, so it pays to avoid using too many on the one page. A logical choice of two typefaces consists of a serif and a sans serif. [http://www.monotype.com/newmedia/type101_ex.htm] Monotype's Typography 101 page provides a category-matchup. They conclude that the moderns and geometrics form good pairs, while the old styles and humanists also go together well. The transitionals are also paired with the humanists. The slab serifs are paired with the grotesques, and some variants of the slab serifs are also said to match the geometrics or humanists. From reading this, one gets the impression that their philosophy is essentially to match the more conservative serifs with the more moderate sans serifs, and pair the wilder modern serifs with the avant garde looking ( pun unavoidable ) geometrics. ----------------------------------------------------------------------------- 3.2. Ligatures, Small caps fonts and expert fonts 3.2.1. Ligatures Properly spacing fonts brings with it all sorts of issues. For example, to properly typeset the letters ``fi'', the i should be very close to the f. The problem is that this causes the dot on the i to collide with the f, and the serif on the head of the i to collide with the horizontal stroke of the f. To deal with this problem, font collections include ligatures. For example, the ``fi'' ligature character is a single character that one can substitute for the two character string ``fi''. Most fonts contain fi and fl ligatures. Expert fonts discussed later often include extra ligatures, such as ffl, ffi, and a dotless i character. ----------------------------------------------------------------------------- 3.2.2. Small caps fonts Small caps fonts are fonts that have reduced size upper case letters in place of the lower case letters. These are useful for writing headings that require emphasis ( and they are often used in LaTeX ). Typically, when one writes a heading in small caps, they use a large cap for the beginning of each word, and small capitals for the rest of the word ( ``title case'' ). The advantage of this over using all caps is that you get something that is much more readable ( using all caps is a big typographic sin ). ----------------------------------------------------------------------------- 3.2.3. Expert fonts Expert fonts consist of several extras designed to supplement a typeface. These include things like ligatures, ornaments ( much like a mini-dingbats collection designed to go with the typeface ), small caps fonts, and swash capitals ( fancy, calligraphic letters ). ----------------------------------------------------------------------------- 3.3. Font Metrics and Shapes Font metrics define the spacing between variable width fonts. The metrics include information about the size of the font, and kerning information, which assigns kerning pairs -- pairs of characters that should be given different spacing. For example, the letters ``To'' would usually belong in a kerning pair, because correctly spaced ( or kerned ), the o should partly sit under the T. Typesetting programs such as LaTeX need to know information about kerning so that they can make decisions about where to break lines and pages. The same applies to WYSIWYG publishing programs. The other important component of a font is the outline, or shape. The components of the fonts shape ( a stroke, an accent, etc ) are called ``glyphs''. ----------------------------------------------------------------------------- 4. Making Fonts Available To X There are a number of ways fonts can be added to X. Firstly, XFree86 has a font path which is just a list of several directories or font servers where it searches for fonts. A font server is just a background process that makes fonts available to XFree86. An advantage of font servers is that they can send fonts to remote displays. Recently, xfs ( the ``X font server'' ) has been patched to support TrueType fonts, and run as a stand-alone program. The patched version ships with RedHat and RedHat-based distributions, and is included in XFree86 4.0 and newer. xfs is actually just the standard font server that comes with XFree86. It's source code is part of the XFree86 source tree. However, distributions have recently been shipping a version that runs in stand-alone mode. The stand-alone X font server, with the TrueType support patch ( the TrueType support takes place via a font server called xfsft ) is probably the nicest font management solution currently available. Its advantages include:   * Support for different types of fonts, including Type 1, TrueType and bitmap.   * Makes fonts available to remote displays.   * Greatly simplifies editing the fontpath -- you can do it via the command line utility chkfontpath, as opposed to having to edit configuration files. This not only makes life easier for users, it makes packaging more safer and more scriptable for packagers. Because different distributions ship with different configurations, it is not true that one size fits all. We can split users up into three groups:   * Your distribution ships with a stand-alone xfs and it has been patched to support TrueType. This group includes Redhat users and users of derivatives of Redhat such as Mandrake, and TurboLinux. Debian 3.0 will also include the patched xfs, currently in testing. For this group, the wisest strategy is to install both TrueType and Type 1 fonts through xfs   * Some distributions ship with a stand-alone xfs package, but no TrueType support. Note that XFree86 supports TrueType as of version 4.0. This includes Debian stable ("potato"). For these users, the best thing to do is use xfs to install Type 1 fonts, and install TrueType fonts via xfstt. Debian users can seek out the [http://www.dimensional.com/~bgiles/ debian-tt.html] TrueType Fonts in Debian mini-HOWTO for information about installing TrueType fonts in Debian.   * If you don't have xfs then you will need to install Type 1 fonts by adding to their XFree86 font path and using xset. using xset. XFree86 3.x users should install TrueType fonts via xfstt, while XFree86 4.x users can add them to the X font path. You should install TrueType fonts via xfstt. ----------------------------------------------------------------------------- 4.1. The font path XFree86 finds your fonts by searching a font path, a list of directories ( or servers -- we'll explain this further later. ) containing fonts. When an application requests a font, it searches through the directories in your font path one at a time until the font is found. To make fonts available requires you to set your font path. You can add a directory to your font path with the command xset fp+ directory Once you have done this, you need to ask the X server to re-scan for available fonts with the command +---------------------------------------------------------------------------+ | xset fp rehash | +---------------------------------------------------------------------------+ Since you will want these commands to run automatically, you should put them in your .xinitrc file ( or possibly your .Xclients or .xsession file -- this depends on how you start X. It's convenient to make two of these files symlinks to the other to avoid confusion ). Another way to have the commands set automatically is edit XF86Config. For example, to add /usr/share/fonts/ myfonts to the font path when X is started, edit XF86Config like this: +---------------------------------------------------------------------------+ | ... | | Section "Files" | | ... | | | | FontPath /usr/share/fonts/myfonts | | ... | | EndSection | | ... | +---------------------------------------------------------------------------+ The advantage of editing XF86Config is that the resulting changes are system wide. ----------------------------------------------------------------------------- 4.2. Installing Type 1 Fonts 4.2.1. Run Type1inst The easiest way to make Type 1 fonts available to X is with the help of the Type1inst utility. This is a perlscript that automatically creates the fonts.dir and fonts.scale files that you need for X to use the fonts. Simply CD to the directory, and run type1inst. cd directory type1inst ----------------------------------------------------------------------------- 4.2.2. If You Have the xfs Package Now you need to add the fonts to your font path. If you already have the stand-alone Section 4.4 running, you do this by editing your xfs configuration file. RedHat users can just use chkfontpath. the format is chkfontpath --add directory Your fonts will be available to X after you restart xfs, or tell it to reload by sending a SIGHUP. You may need to run xset fp rehash as well. Your fonts should now be available to X. Now you just run xset fp rehash and X will be able to find the new fonts. ----------------------------------------------------------------------------- 4.2.3. If You Don't Have The xfs Package In this case, you need to add the directory containing your new fonts to the font path, as described previously. ----------------------------------------------------------------------------- 4.3. True Type Fonts Adding TrueType fonts is a little more difficult, because you need to have a font server that is capable of serving TrueType fonts. Two font servers that do this are xfstt and xfs. xfstt is a TrueType font server. While it's easy to configure, and quite useful, it appear that xfs is becoming more popular. The main advantage of xfs over xfstt is that it supports both Type 1 and TrueType fonts. ----------------------------------------------------------------------------- 4.3.1. xfstt To set up xfstt, just download it and install it. Once you install it, you need to do the following: 1. install fonts into the appropriate directory ( read the documentation that comes with the package ). 2. cd to that directory and run xfstt --sync. This causes it to look for the fonts and create the fonts.dir file. 3. Now add unix/:7100 to your font path. Your TrueType fonts should now display and be available to applications such as GIMP and Netscape. You may want to configure it to start every time your system starts up. Check to see if there's a startup file included ( if you are using RPM, you can use rpm -ql xfstt |grep init and look for the file with a name something like this: /etc/rc.d/init.d/xfstt ) If you don't have an init script, just put two lines in /etc/rc.local like this: +---------------------------------------------------------------------------+ | /usr/X11R6/bin/xfstt --sync | | /usr/X11R6/bin/xfstt & | +---------------------------------------------------------------------------+ ----------------------------------------------------------------------------- 4.4. xfs Some of the newer Linux distributions ship with the X font server xfs configured to run as a stand alone program. Notably, Redhat and all the redhat based distributions use this modularised xfs with TrueType compiled in. Debian also ship xfs, but the version they ship in stable ("potato") doesn't have built in true type support, though the one in testing ("woody") does. Running xfs as a stand alone server has several benefits, especially if it is compiled with TrueType support. The main advantage is that since the font server is no longer attached to the X server, it is possible to serve fonts to remote displays. Also, it makes it much easier to modify the font path. ----------------------------------------------------------------------------- 4.4.1. The xfs Path As a font server, xfs has it's own font path. One might wonder where this fits into the picture. It works like this: you can place the xfs font server in XFree86's font path, by adding unix/:port to the XFree86 font path. Once you do this, any font in the xfs font path automatically becomes available to XFree86. The xfs font path is determined by the xfs configuration file, which is /etc/ X11/fs/config on Redhat, and /etc/X11/xfs/config on Debian. Redhat users do not need to explicitly edit this file, they can use the chkfontpath utility. The syntax is simple: +---------------------------------------------------------------------------+ | chkfontpath --add directory | +---------------------------------------------------------------------------+ Users of other distributions can edit the configuration file as follows: +---------------------------------------------------------------------------+ | catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled, | | ... | | /usr/share/fonts/my_new_fonts/, | | ... | | /usr/share/fonts/some_other_directory | | # in 12 points, decipoints | | default-point-size = 120 | | ... | +---------------------------------------------------------------------------+ The above would add /usr/share/fonts/my_new_fonts/ to the xfs font path. Note that the last line of the list of directories doesn't have a comma at the end. For these modifications to the font path to become effective, xfs must be told to reload by running /etc/init.d/xfs reload or sending it a SIGHUP with "kill -HUP [pid]" or "killall -HUP xfs". Alternately you can just re-start xfs, though if you do that it would be a good idea to re-start your X session too. ----------------------------------------------------------------------------- 4.4.2. Installing a Font Into xfs To prepare a font for xfs, you need to follow the following steps:   * If you don't have xfs installed, you need to install it.   * Put the new fonts in a directory.   * If you are installing Type 1 fonts, prepare the new directory for the server by running type1inst in the directory.   * If you are installing TrueType fonts, ( remember, not all distributions can do TrueType via xfs ! ), prepare the new directory for the server by running ttmkfdir -o fonts.scale mkfontdir in the directory containing your new fonts. If you created a new directory for the fonts you may need to copy fonts.scale to fonts.dir or create a symbolic link. ttmkfdir is part of the freetype package.   * Now you can add the new directory to your xfs search path. Users of Redhat-like distributions can do this with the chkfontpath utility: Other users can do this by editing their xfs configuration file.   * if xfs is already installed on your system, you should see which port it is running on. You can do this as follows: +---------------------------------------------------------------+ | ps ax|grep xfs | +---------------------------------------------------------------+   * Then check your XFree86 font path. xset -q   * If your font path includes something like unix:/port_number were port_number is the port which the server is running on, then you already have xfs set up properly. Otherwise, you should add it to your XFree86 font path. xset fp+ unix/:port_number xset fp rehash You can add it permanently by editing your .xinitrc as explained previously. To add it system wide, edit your XF86Config file ( probably either /etc/X11/ XF86Config, /etc/XF86Config or /usr/X11R6/lib/X11/XF86Config ), by adding a line FontPath "unix:/port_number" in the Files section. Here's an example: +---------------------------------------------------------------+ | ... | | Section "Files" | | ... | | | | FontPath "unix/:-1" | | ... | | EndSection | | ... | +---------------------------------------------------------------+   * If xfs is already properly installed, then you can tell it to reload, as described above, or restart it like this: +---------------------------------------------------------------+ | /etc/rc.d/init.d/xfs restart | +---------------------------------------------------------------+   * After restarting xfs, it's a good idea to restart your X-session. ----------------------------------------------------------------------------- 5. Making Fonts Available To Ghostscript To make fonts available to ghostscript, it suffices to tell ghostscript where the files corresponding to a given font are located. The file that needs to be edited is /usr/share/ghostscript/version/Fontmap. The format is very simple, almost immediately self evident on perusing it. ----------------------------------------------------------------------------- 5.1. Type 1 Adding Type 1 fonts is straightforward. Run type1inst on the directory containing the font. type1inst will output a file called Fontmap. Append this file to the ghostscript Fontmap file. ----------------------------------------------------------------------------- 5.2. True Type Adding truetype fonts is a little trickier, because we have to get the name of the TrueType font. One way (brute force, alas) to do this is using the ttf2pt1 TrueType to Type 1 converter, and grabbing the font name from the afm ( there's got to be a more efficient way ! but this works, ugly as it is ). You do it like this: +---------------------------------------------------------------------------+ | ttf2pt1 -A fontname - 2 > /dev/null |grep FontName | +---------------------------------------------------------------------------+ Then you add an entry to the ghostscript Fontmap file in the correct format, eg some-font (/usr/share/fonts/subdirectory/somefont.pbf); Well, that works fine, but try doing it with 500 or so fonts. This is the kind of thing that calls for a short perlscript: +---------------------------------------------------------------------------+ |#!/usr/bin/perl | |# ttfontmap -- generate fontmap file for TrueType fonts | |my $directory=shift || print STDERR "Usage: ttfontmap {directory}\n"; | | | |$directory=~s/\/$//; | | | |for my $fontname ( glob ( "$directory/*.ttf" ) ) | |{ | | open ( R, "sh -c \"ttf2pt1 -A $fontname - 2>/dev/null\" |" ); | | while ( ) | | { | | if ( $_ =~ /^FontName/ ) | | { | | s/^FontName\s*//; | | chomp; | | print "/" . $_ . " ($fontname);\n" ; | | } | | } | | close R; | |} | +---------------------------------------------------------------------------+ You can [http://pegasus.rutgers.edu/~elflord/font_howto/ttfontmap] download this script To set this script up, all you need to do is cut and paste it into a file called ttfontmap, and place the file somewhere in your PATH ( such as /usr/ bin ). You run this script like this: +---------------------------------------------------------------------------+ | ttfontmap directory > output_file | +---------------------------------------------------------------------------+ where directory is the directory containing the fonts. You are left with the file output_file which you can append to your ghostscript fontmap. Note: some will observe that you could just use ttfontmap directory >> /usr/share/ ghostscript/version/Fontmap However, I advise against this ( what would happen if you typed ``>'' instead of ``>>'' ? ) ----------------------------------------------------------------------------- 5.3. Using Ghostscript To Preview Fonts Once you've made fonts available to ghostscript, you can preview them. Do this by running the ghostscript interpreter on the file prfont.ps in your ghostscript installation, and after you start it, type: /Fontname DoFont at the ghostscript font ( where FontName is the ghostscript name of the font you wish to preview ). There are several other ways you can invoke gs. For example, if you want to create a PostScript file that you can look at in a nicer PostScript viewer such as gv, you can use gs -sDEVICE=pswrite -sOutputFile=somefile.ps prfont.ps Having done this, you can also print your output file. ----------------------------------------------------------------------------- 6. True Type to Type 1 Conversion 6.1. Why ? or perhaps the right question to ask is ``why not ?'' The typical Linux user has experienced a migration from Windows, and probably has an enormous collection of TrueType fonts. Many of these fonts ( eg those that ship with MS Word and Corel's products ) are of fairly good quality. However, some Linux applications, such as Star Office and LaTeX do not support TrueType fonts, but do support Type 1 fonts. update: it looks like Star Office can handle TrueType fonts, but I'm still trying to work out the details. At best, it involves some fairly gruesome hacks. This is a pity, because with ghostscript support for TrueType, and TrueType font servers, Linux has the infrastructure it needs to handle TrueType. ----------------------------------------------------------------------------- 6.2. How ? To convert your TrueType fonts into Type 1 fonts, go to [http:// quadrant.netspace.net.au/ttf2pt1/] http://quadrant.netspace.net.au/ttf2pt1/ and get ttf2pt1. To convert a TrueType to a Type 1 font, use the following syntax: +---------------------------------------------------------------------------+ | ttf2pt1 -b file.ttf name | +---------------------------------------------------------------------------+ Where name is the name of the file corresponding to the new Type 1 font ( ie it's arbitrary. It's a good idea to make it the same as the ttf file. eg ttf2pt1 -b foo.ttf foo. Well, that worked fine for one font. If we have a lot, we need a smarter way to do it. One can just just use a loop: +---------------------------------------------------------------------------+ | for X in *.ttf; do ttf2pt1 -b $X ${X%%.ttf}; done | +---------------------------------------------------------------------------+ Alternatively, you can download the [http://pegasus.rutgers.edu/~elflord/ font_howto/ttfutils-0.2.tar.gz] ttfutils package and use ttf2type1 for the conversions. +---------------------------------------------------------------------------+ | ttf2type1 *.ttf | +---------------------------------------------------------------------------+ ----------------------------------------------------------------------------- 7. WYSIWYG Publishing and Fonts 7.1. Introduction and Overview Installing fonts for WYSIWYG publishing on Linux is a relatively complex task. It typically involves three steps:   * Make the font available to the X server   * Make the font available to ghostscript   * Make the font available to the application The main reason for the complexity is that the font printing system ( ghostscript ) is unrelated to the screen font system. In a way, Linux's left hand does not know what it's right hand is doing. This problem is nontrivial to solve, because it is possible that printer fonts and display fonts reside on different machines, so there is no guarantee that all fonts the XClient uses are printable. The good news is that most WYSIWYG applications use what is a reasonable solution to this problem. The solution involves constructing some kind of mechanism that maps screen fonts to printer fonts ( this is the main issue. There are also other issues, such as grouping bold, italic and roman variants into ``families'' of fonts ). Unfortunately, there is no standard way to do this. It seems that font management standards which address this issue would greatly simplify the installation of fonts into WYSIWYG publishing systems, because all applications could use a system-wide ( as opposed to application-specific ) configuration. ----------------------------------------------------------------------------- 7.2. Applixware There are two ways to install fonts into Applixware. One method involves using FontTastic, which is Applixware's ``private'' font server. The other method involves editing Applixware's fontmap, to use a font already installed on the system. Installing into the font server is more convenient, but fonts installed in this manner may only be printed at 300 dpi. ----------------------------------------------------------------------------- 7.2.1. FontTastic Using FontTastic is the easy way to do it. To install new fonts like this, simply do the following: 1. Run Applixware as root 2. Click on the tools menu. 3. Choose ``Font Installer'' 4. Check ``OK'' in the popup dialog 5. Click the ``Catalogs'' menu and choose ``create'' 6. Fill in the catalog name box. It doesn't matter what you put there. For the rest of this example, we'll assume it's called ``foobar'' 7. Select your foobar catalog from the catalog manipulations list. 8. From the ``Services'' menu, select ``install fonts into -> FontTastic font server'' 9. Make sure catalog foobar is selected in the catalogs list, then press the ``select files'' button. 10. Use the select files dialog to select the fonts you want to install. Press ``OK'' when you've selected the files. For example, if you want to select arial.ttf in the directory /usr/share/fonts/ttfonts/, you would type /usr/share/fonts/ttfonts in the ``Current Directory'' dialog, then select arial.ttf from the files dialog box, then click ``OK''. Note that you can select multiple files, but they all must come from the same directory. 11. You can edit your list by checking on the different fonts in the list box and possibly removing or renaming them. 12. When you're ready, click the ``install fonts'' button. Then click ``OK''. 13. Go to the ``services'' menu and choose ``update''. Check ``OK'' on the annoying modal dialog, then choose exit from the services menu. Exit applix. 14. Congrats, you're done ! The new fonts will be available when you restart Applix. ----------------------------------------------------------------------------- 7.2.2. Using System Wide Fonts With Applixware This method is more involved, but produces better results. I recommend that this method is used for fonts that are really important, and that you use a lot. There are a few steps to this: ----------------------------------------------------------------------------- 7.2.2.1. Make the fonts available to X This is explained Section 4 ----------------------------------------------------------------------------- 7.2.2.2. Make the fonts available to ghostscript This is explained in Section 5.1 ----------------------------------------------------------------------------- 7.2.2.3. Edit the fontmap.dir This is the final step in making your fonts available to Applix, and also the most time consuming step. The file fontmap.dir is in under the axdata/ fontmetrics of your applix installation. The purpose of this step is basically to tell applix which screen fonts go with which outline fonts. This is in general a very nontrivial problem, because the screen fonts are not always on the same computer that the application is installed. We describe how to add fonts to fontmap.dir. In this example, we add the font Baskerville Italic. 1. First, we add a line that says FontRecord = Baskerville-Normal-Italic In fact, the name we use in FontRecord is completely arbitrary. However, the font record must be unique to the font. Because of this, it's good practice to use the name that ghostscript uses for the font. 2. Next, we a line that says Family = Baskerville The family name for a font is the name that appears in Applix's font selection menu. Typically, it is non-unique, since bold, italic, roman and bold-italic variants of a font will typically go under the same family. 3. If the font is either a bold, or italic variant, or both, we need to add the following lines: Slant = 1 if the font is italic, and Weight = 1 if the font is bold. If the font is bold and italic, we add both lines. In this example, we need only add the line Slant = 1 4. We add a line that looks like this: ScreenName = "-paradise-baskerville-medium-i-normal--0-0-0-0-p-0-iso8859-1" The screen name is the name that the X-server uses for the font. We can list font names containing the string ``bask'' by typing xlsfonts|grep -i bask 5. Now we add a line that gives the name of the printer font: PostScriptPrinterName = Baskerville-Normal-Italic 6. Next, we need to specify the location of the font metric file and the outline file MetricsFile = /usr/share/fonts/misc/baskvli.afm Type1FontFileName = /usr/share/fonts/misc/baskvli.pfb If you are adding a TrueType file, you can use ttf2pt1 to generate an afm file : ttf2pt1 -A foo.ttf - > foo.afm ( or get the ttfutils package and use ttf2afm ) Then you use something like this: MetricsFile = /usr/share/fonts/misc/foo.afm Do not include a Type1FontFileName directive -- let ghostscript take care of this. That's it. Now after adding the whole family of fonts, you should have something like this: +------------------------------------------------------------------------------------+ | FontRecord = Baskerville-Normal | | Family = Baskerville | | ScreenName = "-paradise-baskerville-medium-r-normal--0-0-0-0-p-0-iso8859-1" | | PostScriptPrintName = Baskerville-Normal | | MetricsFile = /usr/share/fonts/misc/baskvl.afm | | Type1FontFileName = /usr/share/fonts/misc/baskvl.pfb | | | | FontRecord = Baskerville-Normal-Italic | | Family = Baskerville | | Slant = 1 | | ScreenName = "-paradise-baskerville-medium-i-normal--0-0-0-0-p-0-iso8859-1" | | PostScriptPrintName = Baskerville-Normal-Italic | | MetricsFile = /usr/share/fonts/misc/baskvli.afm | | Type1FontFileName = /usr/share/fonts/misc/baskvli.pfb | | | | FontRecord = Baskerville-Bold | | Family = Baskerville | | Weight = 1 | | ScreenName = "-paradise-baskerville-bold-r-normal--0-0-0-0-p-0-iso8859-1" | | PostScriptPrintName = Baskerville-Bold | | MetricsFile = /usr/share/fonts/misc/baskvlb.afm | | Type1FontFileName = /usr/share/fonts/misc/baskvlb.pfb | | | | FontRecord = Baskerville-Bold-Italic | | Family = Baskerville | | Weight = 1 | | Slant = 1 | | ScreenName = "-paradise-baskerville-bold-i-normal--0-0-0-0-p-0-iso8859-1" | | PostScriptPrintName = Baskerville-Bold-Italic | | MetricsFile = /usr/share/fonts/misc/baskvlbi.afm | | Type1FontFileName = /usr/share/fonts/misc/baskvlbi.pfb | +------------------------------------------------------------------------------------+ It is possible to do more with this configuration file. The file itself has a glossary which explains the format of the configuration file. ----------------------------------------------------------------------------- 7.3. Star Office Here, we cover Star Office 5.0. The procedure with Star Office 5.1 is similar, but the utility is called spadmin, not psetup. It's worth mentioning up front that [http://www.mindspring.com/~john_mcl/adding_fonts.html] John McLaughlin's page is an excellent source on this issue, and it inspired most of what follows. Having tried both Star Office 5.0, and 5.1, I have found that Star Office 5.1 seems to give me less grief when adding new fonts. I was not succesful adding true type fonts to Star Office 5.0, but it proved somewhat easier with Star Office 5.1. ----------------------------------------------------------------------------- 7.3.1. Backup Your Configuration Before you Start ! It's good to make a backup in case you inadvertantly hose your configuration. Modifying fonts will impact several files in the xp3. You should definitely backup the file xp3/psstd.fonts. I recommend going further and backing up the whole xp3 directory. You can do this by cd-ing to your Star Office directory, then using +---------------------------------------------------------------------------+ | tar cvzf xp3.tgz xp3 | +---------------------------------------------------------------------------+ to create a backup. To restore a backup, delete the xp3 directory and unpack the archive +---------------------------------------------------------------------------+ | rm -rf xp3 | | tar xvzf xp3.tgz | +---------------------------------------------------------------------------+ ----------------------------------------------------------------------------- 7.3.2. Adding Type 1 Fonts to Star Office Adding Type 1 fonts to Star Office is relatively simple. If you want to use your TrueType fonts with Star Office 5.0, the best thing to do is convert them to Type 1 fonts, and then follow the procedure outlined here. If you have Star Office 5.1, you might wish to use the proceedure for installing TrueType fonts instead ( though it is somewhat more difficult ). Firstly, do the usual thing -- make the font available to both X and ghostscript. Once this is done, the font can be installed into Star Office using the psetup tool. The procedure is as follows: 1. As root, run psetup ( or spadmin if you have Star Office 5.1 ) 2. Press the ``add fonts'' button. 3. The easiest thing to do after this is press the ``initialize font paths'' button. This puts a list of all fonts in your X font path in the list box. 4. Choose the directory containing the font you wish to install ( it should be in the box ), and then press ``OK''. 5. Click the ``convert all font metrics button''. That's it. You're done. You can exit ( or click ``OK'' until it exits ). When you restart Star Office, you will have the new fonts. ----------------------------------------------------------------------------- 7.3.3. Adding TrueType Fonts to Star Office Adding TrueType fonts to Star Office is nontrivial, but possible. After some hard work, and long hours stareing at [http://www.mindspring.com/~john_mcl/ adding_fonts.html] John McLaughlin's page page, I finally got them working in Star Office 5.1. Note that this does not work with version 5.0. The following steps are appropriate it you are printing through ghostscript:   * Make the fonts available to X.   * Make the fonts available to ghostscript.   * You need to have afm files for the fonts you wish to add. Use +---------------------------------------------------------------+ | ttf2pt1 -A foo.ttf - > foo.afm | | | +---------------------------------------------------------------+ to create the afm files. Alternatively, you can get the   * [http://pegasus.rutgers.edu/~elflord/font_howto/ttfutils-0.2.tar.gz] ttfutils package and use ttf2afm The advantage of this is you can handle several at a time, eg +---------------------------------------------------------------+ | ttf2afm *.ttf | +---------------------------------------------------------------+   * Star Office needs pfb files corresponding to each ttf file. You can create them with the command +---------------------------------------------------------------+ | touch foo.pfb | +---------------------------------------------------------------+ Actually, Star Office only uses these files for printing purposes. And by enterring the font in the PPD, thus duping Star Office into thinking the fonts are inside your printer ( when they're actually inside ghostscript's rendering system ), you get around needing to use these files. Star Office just seems to require that the pfb file exists to install the font.   * Now you can run spadmin and install the font(s).   * Now add the fonts to the PPD file corresponding to your printer configuration. The name you use for the font should be the same name Star Office uses for it, not the ghostscript font name. For example, if the font is foobar.ttf and the corresponding afm file is foobar.afm, you use the name ``foobar'' for the font in the PPD file. The entry should look something like this: +---------------------------------------------------------------+ |*Font cloistrk: Standard "(001.002)" Standard ROM | | | +---------------------------------------------------------------+ On the other hand, if you are not printing from ghostscript, you have different issues to deal with. In this case, tricking Star Office into thinking that your printer has the fonts is a bad idea, because your printer does not have the fonts in the ROM, so while gv will display the PostScript files nicely, your printer will not be able to print them. If you have a PostScript printer, the main differences are as follows:   * Do not edit the PPD file.   * Instead of using touch foo.pfb to create empty pfb files, you need the pfb files to be Type42 PostScript fonts. A Type42 font is really a ``printer TrueType font''. You don't really notice Type42 fonts even when you use them, because most applications handle them transparently. To create Type42 fonts, you use [ftp://ftp.dcs.ed.ac.uk/pub/jek/programs/ ttfps.tar.gz] ttfps to create the files. +---------------------------------------------------------------+ | ttfps foo.ttf foo.pfb | | | +---------------------------------------------------------------+ There are some gotchas. Sometimes, Star Office might not choose the screen font you like. It is sometimes worth checking xp3/psstd.fonts and possibly editing it to make sure that Star Office is really using the font you had in mind for screen display. Also, Star Office doesn't handle configuration problems gracefully. If there's something wrong with your configuration, it's possible that the word processor will not even start. This is why you should back up your xp3 directory. ----------------------------------------------------------------------------- 7.3.4. Under the Hood If you wish to install TrueType fonts in Star Office, you may need to learn how Star Office handles things. When you run spadmin or psetup, the following happens:   * Star Office makes symbolic links to the pfb outline files in your xp3/ pssoftfonts directory.   * The afm file is copied into the directory xp3/fontmetrics/afm/   * An entry is added to the xp3/psstd.fonts file. This file stores the names of all the screen fonts used by Star Office ( in particular, it maps the screen fonts to the outline filenames ). This is why it's good to simply backup the whole xp3 directory -- it is the only convenient way to restore Star Office to a clean configuration. ----------------------------------------------------------------------------- 7.4. Word Perfect Nothing yet. [http://www.rodsbooks.com/wpfonts/] Rod Smith's webpage is the definitive resource regarding installing fonts on Word Perfect. ----------------------------------------------------------------------------- 8. Netscape Perhaps the most notorious application as far as fonts are concerned is the dreaded Netscape. However, there is a fairly simple procedure to attack Netscape font ugliness. The main problem is that Netscape wants to use 75dpi fonts which is typically too small. You can fix this by specifying the appropriate X resources in your .Xdefaults file: +---------------------------------------------------------------------------+ | Netscape*documentFonts.sizeIncrement: 20 | | Netscape*documentFonts.xResolution*iso-8859-1: 100 | | Netscape*documentFonts.yResolution*iso-8859-1: 100 | +---------------------------------------------------------------------------+ The number 100 can be chosen arbitrarily. For example, if you like your fonts really large, like I do, then you may want to use 150 instead. The other essential tip with regard to addressing Netscape font ugliness is this -- get the Microsoft font pack. These fonts are widely used and it makes an enormous difference if you have ( or don't have ) those fonts. ----------------------------------------------------------------------------- 9. TeX / LaTeX 9.1. A Quick Primer on LaTeX/TeX fonts Adding fonts to TeX and LaTeX is a somewhat complex procedure. However, like a lot of things, it's easy if you know how to do it. Some fonts are distributed in metafont format, and some in Type 1 format. Usually, the Type 1 formats are more easily available. However, metafont fonts have the distinct advantage that they can adjust their shape at different sizes, while Type 1 and TrueType fonts at different point sizes are simply magnified or reduced versions of precisely the same shape. The main reason why this feature is desirable is that ideally, fonts should be ( relatively ) wider at smaller sizes and narrower at larger sizes. For this discussion, we focus on Type 1 fonts, since they are more widely available, and more problematic to install. Here's a quick primer on LaTeX fonts. LaTeX uses the following types of font files for handling Type 1 fonts:   * .pl -- property list. This is a human readable version of a tex font metric file.   * .vpl -- virtual property list. Human readable version of a virtual font file.   * .fd -- font definition. Used to define a family of fonts.   * .tfm -- tex font metric. This is a metric file, as explained in the glossary. It is completely analogous to the .afm files used by Type 1 fonts. TeX needs the font metrics to properly layout the page.   * .vf -- virtual font. These files contain encoding details, and act as interpreters. TeX treats them as fonts. For example, Imagine that there's some wacky font foobar-exp.pfb which consists of a few ( say 20 ) alternate characters, and there's a virtual font which uses a few of these alternate characters ( and it gets the rest of the characters from font foobar.pfb ). Dvips might say ``I want character 65 of virtual font foo.vf''. Dvips knows that 65 is always an ``a'' in TeX's scheme. Then the virtual font maps TeX's request to a request for character 14 of the Type 1 font foobar.pfb ( which might be the alternate ``a'' in the Type 1 font foobar.pfb ). The virtual font mechanism is very flexible and allows fonts to be constructed from many different font files. This is useful when using fonts such as adobe's ``expert'' fonts.   * .pk -- a device dependent bitmap font. These are usually constructed on an as-needed basis ( they are renderings of Type 1 and metafont fonts ). They are typically high resolution ( about 300-1200dpi ), and are intended to be rendered on a printer. Because of their high resolution, and the fact that each point size of each font requires a .pk file, they require a lot of disk space, so they are cached, but not stored.   * .mf -- metafont files. Metafont is a graphics programming language widely used for font design ( though it can also be used for graphics ). It has many advantages over TrueType and Type 1 schemes. However, it's main weakness is that it is not as ubiquitous as TrueType or Type 1 ( and it is also not terribly well suited to WYSIWYG publishing. Of course, this isn't a major disadvantage when TeX is your typesetting system. ) It's good to know your way around the TeX directory structure. Here are the main directories you'll need to know about:   * $TEXMF/fonts -- the main font directory   * $TEXMF/fonts/type1 -- the type1 font directory   * $TEXMF/fonts/type1/foundry -- the directory for the shape files in a given foundry   * $TEXMF/fonts/type1/foundry/fontname -- contains the font called name. The name is usually plain English, and needn't follow TeX's cryptic naming scheme for fonts.   * $TEXMF/fonts/afm/foundry/fontname -- the directory containing the afm files corresponding to the font name belonging to foundry foundry.   * $TEXMF/fonts/tfm/foundry/fontname -- analogous to the afm directory, but contains tfm files instead.   * $TEXMF/fonts/vf/foundry/fontname -- similar to the above, but contains the virtual fonts.   * $TEXMF/fonts/source/foundry/fontname -- similar to the above, but contains metafont files.   * $TEXMF/dvips/config/psfonts.map -- fontmap file for dvips. This file is similar in both function and format to ghostscript's Fontmap file.   * $TEXMF/tex/latex/psnfss -- this is where all the font definition files go. ----------------------------------------------------------------------------- 9.2. Adding Type 1 fonts 9.2.1. Naming the fonts First, you need to appropriately name your fonts. See the fontinst documentation on your system for instructions on how to name fonts ( it should be fontinst subdirectory of the directory containing your tetex documentation ). To make a long story very short, the naming scheme is FNW{V} E{n} where:   * F is a one-letter abbreviation for the foundry ( m = monotype, p = adobe, b = bitstream, f = free )   * N is a two letter abbreviation for the font name ( for example, ag = ``avant garde'' )   * W is the font weight ( r = regular, b = bold, l = light d = demibold )   * V is an optional slope variant ( i = italic , o = oblique )   * E is an abbreviation for the encoding ( almost always 8a which is adobe standard encoding ).   * N is an optional width variant ( n = narrow ) For example, the font Adobe Garamond demibold is pgad8a. ----------------------------------------------------------------------------- 9.2.2. Creating the virtual fonts and tex font metrics Now you can run fontinst as follows: latex `kpsewhich fontinst.sty` then you type at the prompt: \latinfamily{font_name}{}\bye where font_name is the first three letters of your font file name ( for example, pad for adobe garamond ). Now fontinst will generate a number of files -- font description files, property list files and virtual property list files. It also generates a lot of .mtx files. These are created by fontinst, but you don't need to use them. You need to convert the property lists and virtual property lists to metrics and virtual fonts. This is done using the utilities vptovf and pltotf. for X in *.pl; do pltotf $X; done for X in *.vpl; do vptovf $X; done Then remove the old vpl, pl and mtx files. ----------------------------------------------------------------------------- 9.2.3. Configure dvips You will need to edit your dvips config file, psfonts.map. The best way to explain the format of the file is to give an example. +---------------------------------------------------------------------------+ | marr8r ArialMT <8r.enc