1Creating letters with consistent stem widths, serifs and heights
2================================================================
3
4Many Latin (Greek, Cyrillic) fonts have serifs, special terminators at the end
5of stems. And in almost all LGC fonts there should only be a small number of
6stem widths used (ie. the vertical stem of "l" and "i" should probably be the
7same).
8
9FontForge does not have a good way to enforce consistency, but it does have
10various commands to help you check for it, and to find discrepancies.
11
12Let us start with the letter "l" and go through the familiar process of
13importing a bitmap and defining its outline.
14
15.. flex-grid::
16
17   * - .. image:: /images/l1.png
18
19       The imported image
20     - .. image:: /images/l2.png
21
22       Use the magnify tool to examine the bottom serif, and note that it is
23       symmetric left to right.
24     - .. image:: /images/l3.png
25
26       Outline the right half of the serif
27     - .. image:: /images/l4.png
28
29       select the outline, invoke :menuselection:`Edit --> Copy` then
30       :menuselection:`Edit --> Paste`, and finally
31       :menuselection:`Element --> Transformations --> Transform` and select
32       ``Flip`` (from the pull down list) and ``check Horizontal``
33   * :flex-widths: 1 2 1
34
35     - .. image:: /images/l5.png
36
37       Drag the flipped serif over to the left until it snuggles up against the left
38       edge of the glyph
39     - .. flex-grid::
40
41          * - .. image:: /images/l6.png
42            - .. image:: /images/l7.png
43
44       Deselect the path, and select one end point and drag it until it is on top of
45       the end point of the other half
46     - .. image:: /images/l8.png
47
48       Finish off the glyph
49   * - But let's do two more things. First let's measure the stem width, and second
50       let's mark the height of the "l"
51     - .. image:: /images/l9.png
52
53       Select the ruler tool from the tool palette, and drag it from one edge of the
54       stem to the other. A little window pops up showing the width is 58 units, the
55       drag direction is 180 degrees, and the drag was -58 units horizontally, and 0
56       units vertically.
57     - .. image:: /images/l10.png
58
59       Go to the layers palette and select the Guide radio box (this makes the guide
60       layer editable). Then draw a line at the top of the "l", this line will be
61       visible in all glyphs and marks the ascent height of this font.
62     -
63
64Now let's do "i". This glyph looks very much like a short "l" with a dot on top.
65So let's copy the "l" into the "i"; this will automatically give us the right
66stem width and the correct advance width. The copy may be done either from the
67font view (by selecting the square with the "l" in it and pressing
68:menuselection:`Edit --> Copy`) or from the outline view (by
69:menuselection:`Edit --> Select --> Select All` and
70:menuselection:`Edit --> Copy`). Similarly the Paste may be done either in the
71font view (by selecting the "i" square and pressing
72:menuselection:`Edit --> Paste`) or the outline view (by opening the "i" glyph
73and pressing :menuselection:`Edit --> Paste`).
74
75.. flex-grid::
76
77   * - .. image:: /images/i1.png
78
79       Import the "i" image, and copy the "l" glyph.
80     - .. image:: /images/i2.png
81
82       Select the top serif of the l
83     - .. image:: /images/i3.png
84
85       drag it down to the right height
86     - .. image:: /images/i4.png
87
88       go to the guide layer and add a line at the x-height
89
90.. image:: /images/o5.png
91   :align: right
92
93Let's look briefly back at the "o" we built before. You may notice that the "o"
94reaches a little above the guide line we put in to mark the x-height (and a
95little below the baseline). This is called overshoot and is an attempt to remedy
96an optical illusion. A curve actually needs to rise about 3% (of its diameter)
97above the x-height for it to appear on the x-height.
98
99Let's look at "k". Again we will copy an "l" into it and import an appropriate
100image.
101
102.. flex-grid::
103
104   * - .. image:: /images/k1.png
105
106       Import the "k" image and copy the "l" glyph. Note that the x-height line
107       matches the "k" (as we would hope). Also note that the width of the "l" is
108       inappropriate for "k" so we'll have to select it and drag it over.
109     - .. image:: /images/k2.png
110
111       Select the knife tool from the palette, and cut the stem of the "l" shape at
112       appropriate points for "k".
113     - .. image:: /images/k3.png
114
115       Remove the splines between the cut points. An easy way to do this is to grab
116       the spline itself, (which selects its end points) and then do
117       :menuselection:`Edit --> Clear`.
118   * - .. image:: /images/k4.png
119
120       Select the end points and convert them into corner points with
121       :menuselection:`Point --> Corner`.
122     - .. image:: /images/k5.png
123
124       Then draw in the outer contour.
125     - .. image:: /images/k6.png
126
127       And the inner contour. Finally do an
128       :menuselection:`Edit --> Select --> Select All` and an
129       :menuselection:`Element --> Correct Direction`.
130