]> git.donarmstrong.com Git - lilypond.git/blob - mf/README
Merge branch 'master' of ssh+git://gpercival@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / mf / README
1
2 This is a font of music symbols.  All MF sources are original.  Most
3 of the documentation is in comments in the MF code.
4
5 Non-square pixels are not supported; with other words, the horizontal and
6 vertical resolution of the output device must be the same.
7
8 Currently, outline fonts are created by using `autotrace', but we are
9 already in the process to convert the MF code directly to PostScript code
10 with a tool called `mf2pt1', which in turn calls `FontForge' to postprocess
11 the output (mainly to remove outline overlaps and to add hints).
12
13 The recommended calling sequence of mf2pt1 is
14
15   mf2pt1 --rounding=0.001 <font>
16
17 You need mf2pt1 version 2.1 or newer.
18
19 Here some guidelines to assure a clean conversion.
20
21 . Never use `---'.  Replace it with `--' together with explicit path
22   directions (if necessary).
23
24 . Don't use self-intersecting outlines in general since it can confuse
25   mf2pt1's algorithm to get the orientation of a closed path.  Note that
26   MetaPost's implementation of the `turningnumber' primitive (which would
27   immediately give the orientation of a path) is severely broken before
28   version 1.0 of MetaPost, thus some hand-made code in mf2pt1.mp is used
29   to work around this bug.
30
31 . If outlines intersect, avoid grazing intersections.  In case two outlines
32   intersect in an explicitly defined point, include this point into both
33   intersecting paths to avoid problems due to rounding errors.
34
35 . Don't use `draw' with a polygonal pen but for straight lines (consisting
36   of exactly two points).  In most cases it is quite easy to emulate `draw'
37   with an explicit definition of the outline or with `penstroke'.
38
39 . Don't apply transformations after calling `fill' -- for example, don't
40   mirror `currentpicture'.  Instead, transform the path and call `fill'
41   afterwards.  This ensures that mf2pt1 gets the correct outline directions
42   which is a necessary prerequisite for FontForge's algorithm to remove
43   overlaps.
44
45
46 Some design rules:
47
48 . Always use smooth curve transitions.  Since this is difficult to see in
49   MetaFont proof sheets (which don't show the tangents) I recommend to call
50   mf2pt1 like this
51
52     FONTFORGE=foo mf2pt1 ...
53
54   (`foo' should be a non-existent program; this avoids the default
55   postprocessing).  Then call FontForge to inspect the outlines.
56
57 . Use rounded corners.
58
59
60 Finally, some rules to assure that rasterization at low resolutions give
61 good results.  Today, this is a minor issue, but in some cases it might show
62 design flaws.
63
64 . Use `define_whole_pixels' and friends where appropriate.
65
66 . Use `hround' and `vround' consistently.  A lot of auxiliary macros are
67   defined in feta-macros.mf.
68
69 . If a path element is duplicated or shifted, use an integer value for the
70   offset.
71
72 . Add `eps' for mirrored paths to assure correct MetaFont rasterization.
73   See the comment and the variables at the end of `feta-params.mf' for
74   details how vertical symmetry should be achieved.