]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-beugel.mf
* lily/font-metric.cc (get_indexed_char_stencil): Bugfix: get
[lilypond.git] / mf / feta-beugel.mf
index a71c2bf789a37db77bfbc61aed510300c65a5ea2..2b36afe51d1d30bc4a8b64f5eec710d06b7aa10a 100644 (file)
@@ -1,36 +1,42 @@
-
+% 
+% feta-beugel.mf -- [Staff] braces
+% 
+% source file of the Feta (not an acronym for Font-En-Tja)
+% pretty-but-neat music font
+% 
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+%                Jan Nieuwenhuizen <janneke@gnu.org>
 
 input feta-autometric;
 input feta-macros;
 
-staffsize# := 20 pt#;  %% arbitrary.
-
+staffsize# := 20 pt#;   %% arbitrary.
 
 input feta-params;
 
-font_coding_scheme "feta braces";
 
-% we set the designsize arbitrarily at 10
-% if the * 10 is left out, pktrace gets confused  over the proper magnification,
-% and makes it too large.
-fet_beginfont("feta-braces", font_count * 10);
+def abc_encode_int (expr i) =
+       if i > 0:
+               abc_encode_int (i div 26) & char (65 + i mod 26)
+       else:
+               "A"
+       fi
+enddef ;
+
+% we must let the design increase for each
+% font to make sure that mftrace doesn't jack up the resolution too highly
+% for the longer braces.
+fet_beginfont ("feta-braces-" & char (97 + font_count), (font_count + 1) * 15,
+               "fetaBraces");
 
 mode_setup;
 
 
 
 save code;
-code := -1;
+code := 64;
 
 
-def abc_encode_int (expr i) =
-       if i > 0:
-               abc_encode_int(i div 26)&char(65 + i mod 26)
-       else:
-               "A"
-       fi
-enddef ;
-
 def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
 
        save pendir, height, width, thin, thick, slt;
@@ -40,8 +46,9 @@ def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
        slt# := slt_sharp;
 
 %% +1  is needed because fet_beginchar increments after dumping the strings.
-fet_beginchar("brace number "&(decimal (code + 1)), "brace"&abc_encode_int(code+1),
-               "brace"&abc_encode_int (code+1))
+fet_beginchar ("brace number " & (decimal (code + 1)),
+  "brace" & abc_encode_int (code - 64),
+  "brace" & abc_encode_int (code - 64))
 
        set_char_box (0, width#, height#/2, height#/2);
          
@@ -75,7 +82,7 @@ enddef;
 save stafflinethickness;
 save increment;
 
-stafflinethickness := 0.5pt#;
+linethickness := 0.5pt#;
 increment := 0.5pt#;
 y := 10pt#;
 
@@ -90,7 +97,12 @@ for i := 0 step 1 until font_count:
     % message "l: "&decimal l;
     % note: define_pixels (x) multiplies x by hppp,
     % must never get bigger than infinity
-    y := min (y + increment, infinity/hppp - 1);
+    y := y + increment;
+
+    if y > infinity/hppp:
+      message "Resolution and/or magnification is too high";
+      error please report: <bug-lilypond@gnu.org>;
+    fi
 
     % x should be about one staff space, taking brace to have
     % default height of 3 staffs, this yields height / 3 / 4 = 12
@@ -98,9 +110,9 @@ for i := 0 step 1 until font_count:
     x := y / 15;
 
     increment := x / 10;
-    stafflinethickness :=  min (0.5pt#, y/150);
+    linethickness :=  min (0.5pt#, y/150);
     if i = font_count:
-      draw_brace (y, x, stafflinethickness);
+      draw_brace (y, x, linethickness);
     fi
   endfor;
 endfor