]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/contributor/feta-font.itexi
Doc: Contributor -- more info on fonts
[lilypond.git] / Documentation / contributor / feta-font.itexi
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @node Modifying the feta font
3 @chapter Modifying the feta font
4
5 @menu
6 * Overview of the feta font::
7 * Font creation tools::
8 * Adding a new font section::
9 * Adding a new glyph::
10 * Building the changed font::
11 @end menu
12
13 @node Overview of the feta font
14 @section Overview of the feta font
15
16 The feta font is a font that was created specifically for use in
17 LilyPond.  The sources for the font are found in mf/*.mf.
18
19 The feta font is merged from a number of subfonts.  Each subfont
20 can contain at most 223 glyphs.
21
22 In LilyPond, glyphs are accessed by glyph name, rather than by code point.
23 Therefore, the naming of glyphs is significant.
24
25 Information about correctly creating glyphs is found in @file{mf/README}.
26 Please make sure you read and understand this file.
27
28 TODO -- we should get mf/README automatically generated from texinfo source
29 and include it here.
30
31
32 @node Font creation tools
33 @section Font creation tools
34
35 The sources for the feta font are written in metafont.  The definitive
36 reference for metafont is "The METAFONT book".  Source for the book is
37 available at CTAN.
38
39 mf2pt1 is used to create type 1 fonts from the metafont sources.
40
41 FontForge is used to display the resulting glyph shapes.
42
43 @node Adding a new font section
44 @section Adding a new font section
45
46 The font is divided into sections, each of which contains less
47 than 223 glyphs.  If more than 223 glyphs are included in a section,
48 an error will be generated.
49
50 Each of the sections is contained in a separate @code{.mf} file.  The
51 files are named according to the type of glyphs in that section.
52
53 When adding a new section, it will be necessary to add the following:
54
55 @itemize
56 @item
57 The code for the glyphs, in a file @code{<section-name>.mf}
58 @item
59 Driver files used to create the font in different sizes
60 @item
61 An entry in the generic file used to create the font, or a new
62 generic file
63 @item
64 If necessary, new entries in the GNUmakefile
65 @end itemize
66
67 See the examples in @code{mf/} for more information.
68
69 @node Adding a new glyph
70 @section Adding a new glyph
71
72 Adding a new glyph is done by modifying the .mf file to which the
73 glyph will be added.
74
75 Necessary functions to draw the glyph can be added anywhere in the file,
76 but it is standard to put them immediately before the glyph definition.
77
78 The glyph definition begins with:
79
80 @example
81 fet_beginchar ("glyph description", "glyphname");
82 @end example
83
84 @noindent
85 with @code{glyph description} replaced with a short description of the
86 glyph, and @code{glyphname} replaced with the glyphname, which is chosen
87 to comply with the naming rules in @file{mf/README}.
88
89 The metafont code used to draw the glyph follows the @code{fet_beginchar}
90 entry.  The glyph is finished with:
91
92 @example
93 fet_endchar;
94 @end example
95
96 @node Building the changed font
97 @section Building the changed font
98
99 In order to rebuild the font after making the changes, the existing
100 font files must be deleted.  The simplest and quickest way to do this
101 is to do:
102
103 @example
104 rm mf/out/*
105 make
106 @end example
107