]> git.donarmstrong.com Git - lilypond.git/commitdiff
Move generic macros used for parmesan fonts into separate file.
authorWerner Lemberg <wl@gnu.org>
Fri, 20 Apr 2007 13:05:27 +0000 (15:05 +0200)
committerWerner Lemberg <wl@gnu.org>
Fri, 20 Apr 2007 13:05:27 +0000 (15:05 +0200)
mf/parmesan-generic.mf
mf/parmesan-heads.mf
mf/parmesan-macros.mf [new file with mode: 0644]

index 7114bc6837dd04a9dcec261b2c61bc41cbbf6af6..5c346be8e97c7905970cb35a78dd5d6deb8cbddc 100644 (file)
@@ -1,11 +1,11 @@
 % -%-Fundamental-%- -*-Metafont-*-
-% parmesan-generic.mf --  implement generic stuff: include lots of files,
-% but don't set dims.
+% parmesan-generic.mf -- implement generic stuff: include lots of files,
+% but don't set dimensions.
 %
 % source file of LilyPond's pretty-but-neat music font
-% 
+%
 % (c) 2002--2006 Juergen Reuter <reuter@ipd.uka.de>
-% 
+%
 
 
 if test = -1:
@@ -13,28 +13,30 @@ if test = -1:
 fi
 
 mode_setup;
-%
+
 staffsize# := design_size * pt#;
 
 input feta-macros;
 input feta-params;
 
+input parmesan-macros;
 
-font_x_height  staff_space#;
 
-fet_beginfont("parmesan", design_size, "parmesanMusic")
-if test = 0: 
-       input parmesan-rests;
-       input parmesan-heads;
-       input parmesan-clefs;
-       input parmesan-custodes
-       input parmesan-accidentals;
-       input parmesan-flags;
-       input parmesan-timesig;
-       input parmesan-scripts;
-       input parmesan-dots;
-else:
+font_x_height staff_space#;
 
-fi
-fet_endfont;
 
+fet_beginfont ("parmesan", design_size, "parmesanMusic")
+       if test = 0:
+               input parmesan-rests;
+               input parmesan-heads;
+               input parmesan-clefs;
+               input parmesan-custodes
+               input parmesan-accidentals;
+               input parmesan-flags;
+               input parmesan-timesig;
+               input parmesan-scripts;
+               input parmesan-dots;
+       else:
+
+       fi
+fet_endfont;
index 56d053d1fe2f6705a34e5e1628842d84f2a1d298..ba12b69ace39622c36ae9035a8f94b4c0f7d8b52 100644 (file)
@@ -145,38 +145,6 @@ fet_beginchar ("Left stemmed notehead", "slneomensural");
 fet_endchar;
 
 
-%
-% Find point on `curve' which gives the tangent between point `p'
-% and `curve'.  To guide the search, two auxiliary points must be
-% specified, `p_in' and `p_out'.  The line between `p' and `p_in'
-% must intersect `curve', while the line between `p' and `p_out'
-% must not.
-%
-def find_tangent (expr p, curve, p_in, p_out) =
-       begingroup;
-       save mid, t, t_good, in, out;
-       pair mid, in, out;
-
-       in := p_in;
-       out := p_out;
-
-       forever:
-               mid := 0.5 [in, out];
-               exitif abs (out - mid) <= eps;
-               t := xpart (curve intersectiontimes (p -- mid));
-               if (t > 0):
-                       in := mid;
-                       t_good := t;
-               else:
-                       out := mid;
-               fi;
-       endfor;
-
-       point t_good of curve
-       endgroup
-enddef;
-
-
 %
 % Some sources (eg. Musix/OpusTeX) think that the appendage should be on
 % the left, some say right.  Right wins democratically.
@@ -411,78 +379,6 @@ fet_beginchar ("Mensural brevis notehead", "s-1mensural");
 fet_endchar;
 
 
-%
-% Shift `curve' along the line given by the auxiliary points `p_in'
-% and `p_out' until `line' is a tangent, and return the shift.
-% If `curve' is shifted to position `p_in', it must intersect
-% `line', while shifted to `p_out' it must not.
-%
-def find_tangent_shift (expr line, curve, p_in, p_out) =
-       begingroup;
-       save mid, t, t_good, in, out;
-       pair mid, in, out;
-
-       in := p_in;
-       out := p_out;
-
-       forever:
-               mid := 0.5 [in, out];
-               exitif abs (out - mid) <= eps;
-               t := xpart ((curve shifted mid) intersectiontimes line);
-               if (t > 0):
-                       in := mid;
-                       t_good := t;
-               else:
-                       out := mid;
-               fi;
-       endfor;
-
-       mid
-       endgroup
-enddef;
-
-
-%
-% Get subpath specified by `dir_in' and `dir_out' of `curve'
-% which is then shifted by `offset'.  Assure that result has
-% the same orientation as `curve'.
-%
-def get_subpath (expr curve, dir_in, dir_out, offset) =
-       begingroup;
-       save t_in, t_out;
-
-       t_in := directiontime dir_in of curve;
-       t_out := directiontime dir_out of curve;
-
-       if t_in > t_out:
-               t_out := t_out + length curve;
-       fi;
-
-       (subpath (t_in, t_out) of curve) shifted offset
-       endgroup
-enddef;
-
-
-%
-% This is the same as `get_subpath', except that the time values
-% used to construct the resulting subpath are rounded to integers.
-%
-def get_subpath_i (expr curve, dir_in, dir_out, offset) =
-       begingroup;
-       save t_in, t_out;
-
-       t_in := directiontime dir_in of curve;
-       t_out := directiontime dir_out of curve;
-
-       if t_in > t_out:
-               t_out := t_out + length curve;
-       fi;
-
-       (subpath (round t_in, round t_out) of curve) shifted offset
-       endgroup
-enddef;
-
-
 def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
        save head_width, head_height;
        save ellipse, ellipse_r;
diff --git a/mf/parmesan-macros.mf b/mf/parmesan-macros.mf
new file mode 100644 (file)
index 0000000..b9bbb5e
--- /dev/null
@@ -0,0 +1,114 @@
+% -%-Fundamental-%- -*-Metafont-*-
+% parmesan-macros.mf -- macros for parmesan font
+% 
+% source file of LilyPond's pretty-but-neat music font
+% 
+% (c) 2001--2006 Juergen Reuter <reuter@ipd.uka.de>
+% 
+
+
+%
+% Find point on `curve' which gives the tangent between point `p'
+% and `curve'.  To guide the search, two auxiliary points must be
+% specified, `p_in' and `p_out'.  The line between `p' and `p_in'
+% must intersect `curve', while the line between `p' and `p_out'
+% must not.
+%
+def find_tangent (expr p, curve, p_in, p_out) =
+       begingroup;
+       save mid, t, t_good, in, out;
+       pair mid, in, out;
+
+       in := p_in;
+       out := p_out;
+
+       forever:
+               mid := 0.5 [in, out];
+               exitif abs (out - mid) <= eps;
+               t := xpart (curve intersectiontimes (p -- mid));
+               if (t > 0):
+                       in := mid;
+                       t_good := t;
+               else:
+                       out := mid;
+               fi;
+       endfor;
+
+       point t_good of curve
+       endgroup
+enddef;
+
+
+%
+% Shift `curve' along the line given by the auxiliary points `p_in'
+% and `p_out' until `line' is a tangent, and return the shift.
+% If `curve' is shifted to position `p_in', it must intersect
+% `line', while shifted to `p_out' it must not.
+%
+def find_tangent_shift (expr line, curve, p_in, p_out) =
+       begingroup;
+       save mid, t, t_good, in, out;
+       pair mid, in, out;
+
+       in := p_in;
+       out := p_out;
+
+       forever:
+               mid := 0.5 [in, out];
+               exitif abs (out - mid) <= eps;
+               t := xpart ((curve shifted mid) intersectiontimes line);
+               if (t > 0):
+                       in := mid;
+                       t_good := t;
+               else:
+                       out := mid;
+               fi;
+       endfor;
+
+       mid
+       endgroup
+enddef;
+
+
+%
+% Get subpath specified by `dir_in' and `dir_out' of `curve'
+% which is then shifted by `offset'.  Assure that result has
+% the same orientation as `curve'.
+%
+def get_subpath (expr curve, dir_in, dir_out, offset) =
+       begingroup;
+       save t_in, t_out;
+
+       t_in := directiontime dir_in of curve;
+       t_out := directiontime dir_out of curve;
+
+       if t_in > t_out:
+               t_out := t_out + length curve;
+       fi;
+
+       (subpath (t_in, t_out) of curve) shifted offset
+       endgroup
+enddef;
+
+
+%
+% This is the same as `get_subpath', except that the time values
+% used to construct the resulting subpath are rounded to integers.
+%
+def get_subpath_i (expr curve, dir_in, dir_out, offset) =
+       begingroup;
+       save t_in, t_out;
+
+       t_in := directiontime dir_in of curve;
+       t_out := directiontime dir_out of curve;
+
+       if t_in > t_out:
+               t_out := t_out + length curve;
+       fi;
+
+       (subpath (round t_in, round t_out) of curve) shifted offset
+       endgroup
+enddef;
+
+
+% EOF