14.03.2013 Views

symbols-a4

symbols-a4

symbols-a4

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

METAFONT can produce “proofs” of fonts—large, labeled versions that showcase the logical structure of<br />

each character. In fact, proof mode is METAFONT’s default mode. To produce a proof of lightbulb10.mf,<br />

issue the following commands at the operating-system prompt:<br />

prompt> mf lightbulb10.mf ⇐ Produces lightbulb10.2602gf<br />

prompt> gftodvi lightbulb10.2602gf ⇐ Produces lightbulb10.dvi<br />

You can then view lightbulb10.dvi with any DVI viewer. The result is shown in Figure 4. Observe how the<br />

grid defined with makegrid at the bottom of Figure 3 draws vertical lines at positions 0, sb, w/2, and w − sb<br />

and horizontal lines at positions 0, −1pt, y2, and h. Similarly, observe how the penlabels command labels all<br />

of the important coordinates: z1, z2, . . . , z8 and z67, which lightbulb.mf defines to lie between z6 and z7.<br />

4<br />

8<br />

7<br />

1<br />

3<br />

67<br />

Figure 4: Proof diagram of lightbulb10.mf<br />

Most, if not all, TEX distributions include a Plain TEX file called testfont.tex which is useful for testing<br />

new fonts in a variety of ways. One useful routine produces a table of all of the characters in the font:<br />

prompt> tex testfont<br />

This is TeX, Version 3.14159 (Web2C 7.3.1)<br />

(/usr/share/texmf/tex/plain/base/testfont.tex<br />

Name of the font to test = lightbulb10<br />

Now type a test command (\help for help):)<br />

*\table<br />

*\bye<br />

[1]<br />

Output written on testfont.dvi (1 page, 1516 bytes).<br />

Transcript written on testfont.log.<br />

The resulting table, stored in testfont.dvi and illustrated in Figure 5, shows every character in the font.<br />

To understand how to read the table, note that the character code for “A”—the only character defined by<br />

lightbulb10.mf—is 41 in hexadecimal (base 16) and 101 in octal (base 8).<br />

The LightBulb10 font is now usable by TEX. L ATEX 2ε, however, needs more information before documents<br />

can use the font. First, we create a font-description file that tells L ATEX 2ε how to map fonts in a given font<br />

family and encoding to a particular font in a particular font size. For symbol fonts, this mapping is fairly simple.<br />

Symbol fonts almost always use the “U” (“Unknown”) font encoding and frequently occur in only one variant:<br />

normal weight and non-italicized. The filename for a font-description file important; it must be of the form<br />

“〈encoding〉〈family〉.fd”, where 〈encoding〉 is the lowercase version of the encoding name (typically “u” for<br />

symbol fonts) and 〈family〉 is the name of the font family. For LightBulb10, let’s call this “bulb”. Figure 6 lists<br />

the contents of ubulb.fd. The document “L ATEX 2ε Font Selection” [L AT00] describes \DeclareFontFamily<br />

and \DeclareFontShape in detail, but the gist of ubulb.fd is first to declare a U-encoded version of the bulb<br />

font family and then to specify that a L ATEX 2ε request for a U-encoded version of bulb with a (m)edium font<br />

111<br />

5<br />

6<br />

2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!