Minor regtest correction.
[lilypond.git] / mf / parmesan-scripts.mf
blob3a43a46aecbb50f717807b7a76c8f45f73e209b4
1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-scripts.mf -- implement ancient script symbols
3
4 % source file of LilyPond's pretty-but-neat music font
5
6 % (c) 2002--2009 Juergen Reuter <reuter@ipd.uka.de>
7
9 fet_begingroup ("scripts");
11 fet_beginchar ("ictus", "ictus");
12         save ht, wd;
13         ht# = .35 staff_space#;
14         wd# = linethickness#;
16         define_pixels (wd, ht);
18         save ellipse, T;
19         path ellipse;
20         transform T;
22         T := identity xscaled wd
23                       yscaled blot_diameter;
24         pickup pencircle transformed T;
25         ellipse := fullcircle transformed T;
27         set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
29         x1 = 0;
30         top y1 = ht / 2;
31         x2 = 0;
32         bot y2 = -ht / 2;
34         fill get_subpath (ellipse, up, down, z1)
35              -- get_subpath (ellipse, down, up, z2)
36              -- cycle;
38         labels (1, 2);
39 fet_endchar;
42 def draw_accentus =
43         save thick, thin, ht, wd;
45         thin# = 1 linethickness#;
46         thick# = 1.2 linethickness#;
47         ht# = .35 staff_space#;
48         wd# = .25 staff_space#;
50         define_pixels (wd, ht, thin, thick);
52         z1 = z2 = (-wd / 2 + thin / 2, -ht / 2 + thin / 2);
53         z3 = z4 = (wd / 2 - thick / 2, ht / 2 - thick / 2);
55         penpos1 (thin, angle (z1 - z3));
56         penpos2 (thin, angle (z1 - z3) + 90);
57         penpos3 (thick, angle (z3 - z1) + 90);
58         penpos4 (thick, angle (z3 - z1));
60         fill z1r
61              .. z2r
62              -- z3l
63              .. z4r
64              .. z3r
65              -- z2l
66              .. cycle;
68         set_char_box (wd#/2, wd#/2, ht#/2, ht#/2);
69 enddef;
72 fet_beginchar ("accentus up", "uaccentus");
73         draw_accentus;
74         penlabels (1, 2, 3, 4);
75 fet_endchar;
78 fet_beginchar ("accentus down", "daccentus");
79         draw_accentus;
80         y_mirror_char;
81 fet_endchar;
84 def draw_half_circle (expr diam) =
85         save diameter, thick;
87         diameter# = diam;
89         define_pixels (diameter);
91         thick = 0.6 linethickness;
93         penpos1 (thick, 0);
94         penpos2 (thick, -90);
95         penpos3 (thick, -180);
97         z1r = (diameter / 2, 0);
98         z2r = (0, -diameter / 2);
99         z3r = (-diameter / 2, 0);
100         
101         penstroke z1e{down}
102                   .. z2e{left}
103                   .. z3e{up};
104 enddef;
107 fet_beginchar ("half circle", "usemicirculus");
108         draw_half_circle (5/16 staff_space#);
110         currentpicture := currentpicture yscaled -1;
112         set_char_box (diameter# / 2, diameter# / 2,
113                       0, diameter# / 2);
114 fet_endchar;
117 fet_beginchar ("half circle", "dsemicirculus");
118         draw_half_circle (5/16 staff_space#);
120         set_char_box (diameter# / 2, diameter# / 2,
121                       diameter# / 2, 0);
123         penlabels (1, 2, 3);
124 fet_endchar;
127 fet_beginchar ("circle", "circulus");
128         save diameter, thick;
130         diameter# = 5/16 staff_space#;
132         define_pixels (diameter);
134         thick = 0.6 linethickness;
136         fill fullcircle scaled diameter;
137         unfill fullcircle scaled (diameter - 2 thick);
139         set_char_box (diameter# / 2, diameter# / 2,
140                       diameter# / 2, diameter# / 2);
141 fet_endchar;
144 fet_beginchar ("augmentum", "augmentum");
145         save diameter;
147         diameter# = 0.25 staff_space#;
149         define_pixels (diameter);
151         pickup pencircle scaled diameter;
153         drawdot (0, 0);
155         set_char_box (diameter# / 2, diameter# / 2,
156                       diameter# / 2, diameter# / 2);
157 fet_endchar;
160 def draw_signum_congruentiae =
161         set_char_box (0.50 staff_space# + 1.5 linethickness#,
162                       0.50 staff_space# + 1.5 linethickness#,
163                       2.5 linethickness#,
164                       2.00 staff_space# + 3.5 linethickness#);
166         save ellipse, pat;
167         path ellipse, pat;
169         ellipse := fullcircle xscaled 1.0 linethickness
170                               yscaled 5.0 linethickness
171                               rotated -35;
173         z1 = (+0.50 staff_space, +2.00 staff_space);
174         z2 = (+0.00 staff_space, +2.00 staff_space);
175         z3 = (-0.50 staff_space, +1.50 staff_space);
176         z4 = (-0.25 staff_space, +1.00 staff_space);
177         z5 = (+0.10 staff_space, +0.80 staff_space);
178         z6 = (+0.00 staff_space, +0.00 staff_space);
180         pat := z1{-1, +1}
181                .. z2
182                .. z3
183                .. z4
184                .. z5
185                .. z6;
187         % we avoid cusps originally present in `draw pat'
188         fill get_subpath (ellipse,
189                           -direction 0 of pat, direction 0 of pat, z1)
190              .. get_subpoint (ellipse, direction 1 of pat, z2)
191                   {direction 1 of pat}
192              .. get_subpoint (ellipse, direction 2 of pat, z3)
193                   {direction 2 of pat}
194              .. get_subpoint (ellipse, direction 3 of pat, z4)
195                   {direction 3 of pat}
196              .. get_subpoint (ellipse, direction 4 of pat, z5)
197                   {direction 4 of pat}
198              .. get_subpath (ellipse,
199                              direction 4.8 of pat, -direction 5 of pat, z6)
200              .. get_subpoint (ellipse, -direction 4 of pat, z5)
201                   {-direction 4 of pat}
202              .. get_subpoint (ellipse, -direction 3 of pat, z4)
203                   {-direction 3 of pat}
204              .. get_subpoint (ellipse, -direction 2.5 of pat, point 2.5 of pat)
205              .. get_subpoint (ellipse, -direction 1 of pat, z2)
206                   {-direction 1 of pat}
207              .. cycle;
209         pickup pencircle scaled 3.0 linethickness;
211         z7 = (-0.5 staff_space, +0.0 staff_space);
212         z8 = (+0.5 staff_space, +0.0 staff_space);
214         drawdot z7;
215         drawdot z8;
216 enddef;
219 fet_beginchar ("signum congruentiae up", "usignumcongruentiae");
220         draw_signum_congruentiae;
221         labels (1, 2, 3, 4, 5, 6, 7, 8);
222 fet_endchar;
225 fet_beginchar ("signum congruentiae down", "dsignumcongruentiae");
226         draw_signum_congruentiae;
227         xy_mirror_char;
228 fet_endchar;
231 fet_endgroup ("scripts");