Debian Codegraph @

doc/sphinx/tutorial/editexample7.rst

raw
1 Checking and generating a font
2 ==============================
3
4
5 Checking a font
6 ---------------
7
8 After you have finished making all the glyphs in your font you should check it
9 for inconsistencies. FontForge has a command,
10 :doc:`Element->Find Problems </ui/dialogs/problems>` which is designed to find many common
11 problems.
12
13 Simply select all the glyphs in the font and then bring up the Find Problems
14 dialog. Be warned though: Not everything it reports as a problem is a real
15 problem, some may be an element of the font's design that FontForge does not
16 expect.
17
18 The dialog can search for problems like:
19
20 * Stems which are close to but not exactly some standard value.
21 * Points which are close to but not exactly some standard height
22 * Paths which are almost but not quite vertical or horizontal
23 * Control points which are in unlikely places
24 * Points which are almost but not quite on a hint
25 * ...
26
27 I find it best just to check for a similar problems at a time, otherwise
28 switching between different kinds of problems can be distracting.
29
30
31 Bitmaps
32 -------
33
34 At this point you might want some bitmaps to go with the outline font (this is
35 not compulsory). Go to :menuselection:`Element --> Bitmap Strikes Available` and
36 select the pixel sizes you want bitmaps in (Note, that on X and MS windows pixel
37 sizes often do not correspond exactly to point sizes. You can then use the
38 bitmap editor (:doc:`Window->Open Bitmap </ui/mainviews/bitmapview>`) to clean up the bitmaps,
39 or you can generate your bitmap fonts and then
40 `use someone else's bitmap editor to clean them up <http://math.nmsu.edu/~mleisher/Software/gbdfed/>`__.
41
42 .. image:: /images/BitmapView.png
43
44 Bitmaps are discussed in more detail in the :doc:`next section. <editexample8>`
45
46
47 Generating a font
48 -----------------
49
50 If you save your file it will be saved in a format that only FontForge
51 understands (as far as I know anyway). This is not very helpful if you want to
52 use the font.
53
54 .. image:: /images/generate.png
55 :align: right
56
57 Instead you must use :doc:`File->Generate </ui/dialogs/generate>` to convert your font into
58 one of the standard font formats. FontForge presents what looks like a vast
59 array of font formats, but in reality there are just several variants on a few
60 basic font formats: PostScript Type 1, TrueType, OpenType (and for CJK fonts,
61 also CID-keyed fonts).
62
63 You also have a choice of bitmap formats. FontForge supports bdf (used by X),
64 mac NFNT (used by the Mac), Windows FNT (used by Windows 2.0 I think) and
65 storing bitmaps inside true (or open) type wrappers.
66
67
68 Font Families
69 -------------
70
71 After you have generated a font, you probably want to generate a sequence of
72 similar fonts. In Latin, Greek and Cyrillic fonts italic (or oblique), bold,
73 condensed, expanded styles are fairly common.
74
75 Fonts with different styles in the same family should share the same Family Name
76 (in the :doc:`Element->Font Info->Names </ui/dialogs/fontinfo>` dialog). The Font Name
77 should be the Family Name with the style name(s) appended to the end, often
78 preceded by a hyphen. So in the font family "Helvetica" all fonts should have
79 the Family Name set to "Helvetica". The plain style could be called simply
80 "Helvetica" or "Helvetica-Regular", the bold style "Helvetica-Bold", the oblique
81 (Helvetica doesn't have a true italic) "Helvetica-Oblique", etc.
82
83 FontForge has a menu :ref:`Element->Style <elementmenu.Style>` which is designed
84 to help you create different styles (bold, italic, oblique, condensed, extended,
85 smallcaps,...) of a font a plain face. None of these transformations is perfect,
86 be sure to check the results.
87
88 The :doc:`Element->Transform->Transform->Skew </ui/dialogs/transform>` command can turn a
89 plain font into an Oblique one. Creating a true italic font is generally a bit
90 more complex, the shape of the "a" changes dramatically to "*a*", the "f" gains
91 a descender as "*f*", the serifs on "ilm" etc. become rounded as "*ilm*" and
92 there will probably be other subtle differences. Also, after having skewed a
93 font you should :ref:`Element->Add Extrema <elementmenu.Add-Extrema>`.
94
95 If you already have a "Bold" and a "Plain" style of a font (and each glyph has
96 the same number of points in the same order), you can use the
97 :ref:`Element->Interpolate Font <elementmenu.Interpolate>` command to generate a
98 "DemiBold" style.
99
100 TrueType fonts (and Windows) support a very fine gradation of stem thicknesses
101 (the Mac really only understands Plain and Bold). If you go to
102 :ref:`Element->Font Info->OS/2 <fontinfo.TTF-Values>` you can set the weight to
103 be any value between 0 and 999 (with plain generally being at 400 or 500, and
104 Bold at 700). TrueType fonts also support a range of widths (while the Mac only
105 supports condensed, plain and expanded).
106
107 .. image:: /images/GenerateFamily.png
108 :align: right
109 :alt: Dialog for Generate Mac Family
110
111 On Windows machines, as long as you get the names right, the system should be
112 able to figure out what fonts go into what families. But on the Mac the
113 situation is (or was, it is changing and I don't understand all the new
114 extensions yet) more complicated. The Mac supports a limited range of styles
115 (plain, italic, bold, outline, condensed, expanded and combinations of these)
116 anything outside these must go into a separate family. Then a special table
117 needs to be constructed (called the FOND) which holds pointers to the various
118 fonts in the family. If you open all the fonts you want to be in a given family
119 (and if they have been given the proper names) and then from the plain font
120 select :ref:`File->Generate Family <filemenu.GenerateMac>`. This will list all
121 the fonts that FontForge thinks belong to the same family as the current font
122 and will allow you to generate a FOND structure as well as font files for all
123 family members (sometimes all the fonts live in one file, sometimes they don't,
124 it depends on the font format chosen).
125
126
127 Final Summary
128 -------------
129
130 So you have made a new font. But it does you no good just sitting on your disk,
131 you must install it on your machine. On some systems this is as simple as just
132 dragging the new font into your system Fonts folder, but on other systems there
133 is a fair amount work involved still. See the
134 :ref:`Installing fonts FAQ <faq.font-install>`.
135
136 For a tutorial about
137 :doc:`FontForge's scripting mechanism click here </tutorial/scripting-tutorial>`.