]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-beugel.mf
* .cvsignore: Remove stepmake (huh!?!), add lib.
[lilypond.git] / mf / feta-beugel.mf
index 24a7168156e20e16f31f9861148b994d03911813..61ec9abec0624cf8b284d2ba0cb511abf1077ce3 100644 (file)
@@ -2,15 +2,26 @@ input feta-autometric;
 input feta-macros;
 input feta-params;
 
+font_coding_scheme "feta braces";
+
+
 fet_beginfont("feta-braces", 16);
 mode_setup;
 
 staffsize#:=16pt#;
 
 save code;
-code := 0;
+code := -1;
 
 
+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;
@@ -19,8 +30,10 @@ def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
        width# := width_sharp;
        slt# := slt_sharp;
 
-       beginchar(code, width#, height#/2, height#/2);
-       code := incr code;
+fet_beginchar("brace number "&(decimal code), "brace"&abc_encode_int(code),
+               "brace"&abc_encode_int (code))
+
+       set_char_box (0, width#, height#/2, height#/2);
          
        define_pixels (height, width, slt);
        thin = 2 slt;
@@ -44,13 +57,16 @@ def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
                .. z2l .. simple_serif (z1l, z1r, 90) ..cycle;
 
        addto currentpicture also currentpicture yscaled -1;
-endchar;
+fet_endchar;
 enddef;
 
 
 
-% l is the increment.
-l := 0.2pt#;
+save stafflinethickness;
+save increment;
+
+stafflinethickness := 0.5pt#;
+increment := 0.5pt#;
 y := 10pt#;
 
 
@@ -60,18 +76,21 @@ for i := 0 step 1 until font_count:
   %% We can't store more than 64 (65?) height dimensions in a TFM
   %% file, so we make small files.
 
-  for j := 0 step 1 until 65:
+  for j := 0 step 1 until 63:
     % message "l: "&decimal l;
     % note: define_pixels (x) multiplies x by hppp,
     % must never get bigger than infinity
-    y := min (y + l / 2, infinity/hppp - 1);
+    y := min (y + increment, infinity/hppp - 1);
+
     % x should be about one staff space, taking brace to have
-    % default height of 3 staffs, this yields height / 3 / 4
-    x := y / 12;
-    % l should be about one stafflinethickness
-    l := x / 10;
+    % default height of 3 staffs, this yields height / 3 / 4 = 12
+    % but 15 looks better
+    x := y / 15;
+
+    increment := x / 10;
+    stafflinethickness :=  min (0.5pt#, y/150);
     if i = font_count:
-      draw_brace (y, x, l);
+      draw_brace (y, x, stafflinethickness);
     fi
   endfor;
 endfor