1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @node Modifying the Emmentaler font
3 @chapter Modifying the Emmentaler font
6 * Overview of the Emmentaler font::
7 * Font creation tools::
8 * Adding a new font section::
10 * Building the changed font::
11 * METAFONT formatting rules::
14 @node Overview of the Emmentaler font
15 @section Overview of the Emmentaler font
17 Emmentaler was created specifically for use in LilyPond. The font
18 consists of two @emph{sub-sets} of glyphs. @qq{Feta}, used for clasical
19 notation and @qq{Parmesan}, used for Ancient notation. The sources of
20 which are all found in mf/*.mf.
22 The font is merged from a number of subfonts. Each subfont can contain
23 at most 224 glyphs. This is because each subfont is limited to a
24 one-byte address space (256 glyphs maximum) and we avoid the first 32
25 points in that address space, since they are non-printing control
28 In LilyPond, glyphs are accessed by a @q{glyph name}, rather than by
29 code point. Therefore, the name of a glyph is significant.
31 Information about correctly creating glyphs is found in @file{mf/README}.
32 Please make sure you read and understand this file.
34 TODO -- we should get mf/README automatically generated from texinfo
35 source and include it here.
38 @node Font creation tools
39 @section Font creation tools
41 The sources for Emmentaler are written in metafont. The definitive
42 reference for metafont is "The METAFONT book" -- the source of which is
45 mf2pt1 is used to create type 1 fonts from the metafont sources.
47 FontForge is used to postprocess the output of mf2pt1 and clean up
48 details of the font. It can also be used by a developer to
49 display the resulting glyph shapes.
52 @node Adding a new font section
53 @section Adding a new font section
55 The font is divided into sections, each of which contains less
56 than 224 glyphs. If more than 224 glyphs are included in a section,
57 an error will be generated.
59 Each of the sections is contained in a separate @code{.mf} file. The
60 files are named according to the type of glyphs in that section.
62 When adding a new section, it will be necessary to add the following:
66 The code for the glyphs, in a file @code{<section-name>.mf}
68 Driver files used to create the font in different sizes
70 An entry in the generic file used to create the font, or a new
73 If necessary, new entries in the GNUmakefile
75 An entry in @file{scripts/build/gen-emmentaler-scripts.py}
78 See the examples in @code{mf/} for more information.
81 @node Adding a new glyph
82 @section Adding a new glyph
84 Adding a new glyph is done by modifying the .mf file to which the
87 Necessary functions to draw the glyph can be added anywhere in the file,
88 but it is standard to put them immediately before the glyph definition.
90 The glyph definition begins with:
93 fet_beginchar ("glyph description", "glyphname");
97 with @code{glyph description} replaced with a short description of the
98 glyph, and @code{glyphname} replaced with the glyphname, which is chosen
99 to comply with the naming rules in @file{mf/README}.
101 The metafont code used to draw the glyph follows the @code{fet_beginchar}
102 entry. The glyph is finished with:
109 @node Building the changed font
110 @section Building the changed font
112 In order to rebuild the font after making the changes, the existing
113 font files must be deleted. The simplest and quickest way to do this
122 @node METAFONT formatting rules
123 @section METAFONT formatting rules
125 There are special formatting rules for METAFONT files.
127 Tabs are used for the indentation of commands.
129 When a path contains more than two points, put each point on a
130 separate line, with the operator at the beginning of the line.
131 The operators are indented to the same depth as the initial point
132 on the path using spaces. The indentation mechanism is illustrated
133 below, with @samp{------->} indicating a tab character and any other
134 indentation created using spaces.
137 def draw_something (test) =
139 ------->------->fill z1
140 ------->-------> -- z2
141 ------->-------> -- z3
142 ------->-------> .. cycle;