On Sun, 8 Oct 2006, Juergen Reuter wrote:

* The "longa notes" bug (cp.
 http://lists.gnu.org/archive/html/lilypond-devel/2006-10/msg00022.html)
 has been tracked down to a general problem in output-lib.scm (see
 http://lists.gnu.org/archive/html/lilypond-devel/2006-10/msg00050.html
 for details).  However, to fix it properly, note-head::calc-glyph-name
 should be completely rewritten (i.e. add test for empty style value in
 case statement and handle it identically as "default" style; also
 replace "case" statement by completely different way of dispatch to gain
 speed, e.g. with a hashtable or alist or...), which goes beyond my
 scheme skills.  Any help from scheme/guile gurus is appreciated!

Attached patch should fix this one and theoretically even *speed up* glyph name lookup, since it removes obsolete scheme code. Instead of trying to fix the scheme code, I added a new longa note head to the feta font. It looks exactly like a brevis head, but with a stem like quarter note. Maximae are not handled by this patch, but I actually have not ever seen a Maxima in modern font, so this is a generally open issue to be handled separately.

May I apply this patch?

Greetings,
Juergen
Index: ChangeLog
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ChangeLog,v
retrieving revision 1.5397
diff -u -r1.5397 ChangeLog
--- ChangeLog   11 Oct 2006 19:54:32 -0000      1.5397
+++ ChangeLog   11 Oct 2006 20:12:37 -0000
@@ -7,6 +7,10 @@
 
        * mf/parmesan-heads.mf: Fix typo in comment.
 
+       * mf/feta-bolletjes.mf, scm/output-lib.scm: Fix longa notes bug by
+       adding longa head to feta font and removing obsolete default
+       mapping scheme code.
+
 2006-10-10  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
        * scm/output-lib.scm (fingering::calc-text): use origin
Index: mf/feta-bolletjes.mf
===================================================================
RCS file: /cvsroot/lilypond/lilypond/mf/feta-bolletjes.mf,v
retrieving revision 1.79
diff -u -r1.79 feta-bolletjes.mf
--- mf/feta-bolletjes.mf        4 Oct 2006 16:00:19 -0000       1.79
+++ mf/feta-bolletjes.mf        11 Oct 2006 20:12:37 -0000
@@ -148,6 +148,77 @@
 %
 % dimensions aren't entirely right.
 %
+def draw_longa (expr up) =
+       save stemthick, fudge;
+
+       stemthick# = 2 stafflinethickness#;
+       define_whole_blacker_pixels (stemthick);
+
+       fudge = hround (blot_diameter / 2);
+
+       draw_outside_ellipse (1.80, 0, 0.707, 0);
+       undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
+
+       pickup pencircle scaled stemthick;
+
+       if up:
+               bot y1 = -d;
+               y2 = h;
+               rt x1 - fudge = 0;
+               x1 = x2;
+
+               fudge + lft x3 = w;
+               x4 = x3;
+               top y4 = h + 3.0 staff_space;
+               y3 = y1;
+       else:
+               bot y1 = -d - 3.0 staff_space;
+               top y2 = h;
+               rt x1 - fudge = 0;
+               x1 = x2;
+
+               fudge + lft x3 = w;
+               x4 = x3;
+               y4 = y2;
+               bot y3 = -d;
+       fi;
+
+       draw_gridline (z1, z2, stemthick);
+       draw_gridline (z3, z4, stemthick);
+enddef;
+
+
+fet_beginchar ("Longa notehead", "u-2");
+       draw_longa (true);
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+fet_beginchar ("Longa notehead", "d-2");
+       draw_longa (false);
+
+       draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+       fet_beginchar ("Longa notehead", "u-2");
+               draw_longa (true);
+
+               draw_staff (-2, 2, 0.5);
+       fet_endchar;
+
+       fet_beginchar ("Longa notehead", "d-2");
+               draw_longa (false);
+
+               draw_staff (-2, 2, 0.5);
+       fet_endchar;
+fi;
+
+
+%
+% dimensions aren't entirely right.
+%
 def draw_brevis =
        save stemthick, fudge;
 
Index: scm/output-lib.scm
===================================================================
RCS file: /cvsroot/lilypond/lilypond/scm/output-lib.scm,v
retrieving revision 1.115
diff -u -r1.115 output-lib.scm
--- scm/output-lib.scm  10 Oct 2006 13:38:32 -0000      1.115
+++ scm/output-lib.scm  11 Oct 2006 20:12:37 -0000
@@ -119,6 +119,10 @@
        (log (min 2 (ly:grob-property grob 'duration-log))))
     
     (case style
+      ;; "default" style is directly handled in note-head.cc as a
+      ;; special case (HW says, mainly for performance reasons).
+      ;; Therefore, style "default" does not appear in this case
+      ;; statement.  -- jr
       ((xcircle) "2xcircle")
       ((harmonic) "0harmonic")
       ((baroque) 
@@ -137,16 +141,6 @@
           (string-append (number->string log) (symbol->string style))))
       ((neomensural)
        (string-append (number->string log) (symbol->string style)))
-      ((default)
-       ;; The default font in mf/feta-bolletjes.mf defines a brevis, but
-       ;; neither a longa nor a maxima.  Hence let us, for the moment,
-       ;; take these from the neo-mensural font.  TODO: mf/feta-bolletjes
-       ;; should define at least a longa for the default font.  The longa
-       ;; should look exactly like the brevis of the default font, but
-       ;; with a stem exactly like that of the quarter note. -- jr
-       (if (< log -1)
-          (string-append (number->string log) "neomensural")
-          (number->string log)))
       (else
        (if (string-match "vaticana*|hufnagel*|medicaea*" (symbol->string 
style))
           (symbol->string style)
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to