CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/10/16 13:52:42

Modified files:
        input/regression: arpeggio-bracket.ly arpeggio-collision.ly 
                          arpeggio.ly auto-beam-bar.ly 
                          auto-beam-no-beam.ly auto-beam-triplet.ly 
                          auto-beam-tuplets.ly auto-beam.ly 
                          auto-change.ly backend-excercise.ly 
        lily           : bar-line.cc grob.cc ligature-engraver.cc 
                         line-spanner.cc note-head.cc stem.cc 
        lily/include   : note-head.hh 
        scm            : define-grob-properties.scm define-grobs.scm 
                         output-lib.scm 

Log message:
        * lily/note-head.cc (calc_stem_attachment): new function.
        (internal_print): use callback to get glyph-name.
        
        * lily/stem.cc (calc_stem_end_position): new function.
        (calc_length): new function.
        document details for stem.
        remove Stem::get_direction()
        
        * lily/bar-line.cc (before_line_breaking): remove function.
        remove bar-size-procedure, break-glyph-function
        
        * lily/grob.cc (get_stencil): simplify: use callback mechanism to
        calculate stencil.
        (get_print_stencil): rename from get_stencil: create stencil with
        transparency, color and cause.
        
        * scm/define-grobs.scm: change print-function to stencil callback 
everywhere.
        
        * lily/grob.cc: elucidate doc about after/before-line-breaking
        
        * lily/stem.cc (height): idem.
        
        * lily/grob.cc: change after/before-line-breaking-callback to
        after/before-line-breaking dummy properties.
        
        * lily/grob.cc (other_axis_parent_positioning): new function.
        (same_axis_parent_positioning): new function
        
        * lily/stem.cc (calc_stem_end_position): use callback.
        (calc_positioning_done): idem.
        (calc_direction): idem.
        (calc_stem_end_position): idem
        (calc_stem_info): idem.
        
        * scm/define-grob-properties.scm (all-user-grob-properties): doc
        callbacks property.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/arpeggio-bracket.ly.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/arpeggio-collision.ly.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/arpeggio.ly.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/auto-beam-bar.ly.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/auto-beam-no-beam.ly.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/auto-beam-triplet.ly.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/auto-beam-tuplets.ly.diff?tr1=1.34&tr2=1.35&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/auto-beam.ly.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/auto-change.ly.diff?tr1=1.38&tr2=1.39&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/backend-excercise.ly.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/bar-line.cc.diff?tr1=1.61&tr2=1.62&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/grob.cc.diff?tr1=1.148&tr2=1.149&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/ligature-engraver.cc.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/line-spanner.cc.diff?tr1=1.65&tr2=1.66&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/note-head.cc.diff?tr1=1.155&tr2=1.156&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/stem.cc.diff?tr1=1.281&tr2=1.282&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/include/note-head.hh.diff?tr1=1.61&tr2=1.62&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-grob-properties.scm.diff?tr1=1.128&tr2=1.129&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-grobs.scm.diff?tr1=1.251&tr2=1.252&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/output-lib.scm.diff?tr1=1.87&tr2=1.88&r1=text&r2=text

Patches:
Index: lilypond/input/regression/arpeggio-bracket.ly
diff -u lilypond/input/regression/arpeggio-bracket.ly:1.18 
lilypond/input/regression/arpeggio-bracket.ly:1.19
--- lilypond/input/regression/arpeggio-bracket.ly:1.18  Mon Aug 22 17:28:50 2005
+++ lilypond/input/regression/arpeggio-bracket.ly       Sun Oct 16 13:52:41 2005
@@ -1,7 +1,7 @@
 \layout { raggedright= ##t }
 
 
-\version "2.6.0"
+\version "2.7.13"
 \header{
   texidoc="
 A square bracket on the left indicates that the player should not
Index: lilypond/input/regression/arpeggio-collision.ly
diff -u lilypond/input/regression/arpeggio-collision.ly:1.37 
lilypond/input/regression/arpeggio-collision.ly:1.38
--- lilypond/input/regression/arpeggio-collision.ly:1.37        Mon Aug 22 
17:28:50 2005
+++ lilypond/input/regression/arpeggio-collision.ly     Sun Oct 16 13:52:41 2005
@@ -1,4 +1,4 @@
-\version "2.6.0"
+\version "2.7.13"
 
 \header  {
 texidoc = "Arpeggio stays clear of accidentals and flipped note heads."
Index: lilypond/input/regression/arpeggio.ly
diff -u lilypond/input/regression/arpeggio.ly:1.36 
lilypond/input/regression/arpeggio.ly:1.37
--- lilypond/input/regression/arpeggio.ly:1.36  Mon Aug 22 17:28:50 2005
+++ lilypond/input/regression/arpeggio.ly       Sun Oct 16 13:52:41 2005
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.13"
 \header{
   texidoc="
 Arpeggios are supported, both cross-staff and broken single staff.
Index: lilypond/input/regression/auto-beam-bar.ly
diff -u lilypond/input/regression/auto-beam-bar.ly:1.33 
lilypond/input/regression/auto-beam-bar.ly:1.34
--- lilypond/input/regression/auto-beam-bar.ly:1.33     Mon Aug 22 17:28:50 2005
+++ lilypond/input/regression/auto-beam-bar.ly  Sun Oct 16 13:52:41 2005
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.13"
 
 \header{
 texidoc="No auto beams will be put over (manual) repeat bars."
Index: lilypond/input/regression/auto-beam-no-beam.ly
diff -u lilypond/input/regression/auto-beam-no-beam.ly:1.15 
lilypond/input/regression/auto-beam-no-beam.ly:1.16
--- lilypond/input/regression/auto-beam-no-beam.ly:1.15 Sun Jun 26 22:39:13 2005
+++ lilypond/input/regression/auto-beam-no-beam.ly      Sun Oct 16 13:52:41 2005
@@ -6,7 +6,7 @@
 
     }
 
-\version "2.6.0"
+\version "2.7.13"
 \layout {
     raggedright = ##t
 }
Index: lilypond/input/regression/auto-beam-triplet.ly
diff -u lilypond/input/regression/auto-beam-triplet.ly:1.30 
lilypond/input/regression/auto-beam-triplet.ly:1.31
--- lilypond/input/regression/auto-beam-triplet.ly:1.30 Mon Aug 22 17:28:50 2005
+++ lilypond/input/regression/auto-beam-triplet.ly      Sun Oct 16 13:52:41 2005
@@ -4,7 +4,7 @@
   texidoc = "Automatic beaming is also done on tuplets."
 }
 
-\version "2.6.0"
+\version "2.7.13"
 \layout { raggedright= ##t }
 
 \relative c''{
Index: lilypond/input/regression/auto-beam-tuplets.ly
diff -u lilypond/input/regression/auto-beam-tuplets.ly:1.34 
lilypond/input/regression/auto-beam-tuplets.ly:1.35
--- lilypond/input/regression/auto-beam-tuplets.ly:1.34 Mon Aug 22 17:28:50 2005
+++ lilypond/input/regression/auto-beam-tuplets.ly      Sun Oct 16 13:52:41 2005
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.13"
 
 \header {
   texidoc = "Tuplet-spanner should not put (visible) brackets on
Index: lilypond/input/regression/auto-beam.ly
diff -u lilypond/input/regression/auto-beam.ly:1.30 
lilypond/input/regression/auto-beam.ly:1.31
--- lilypond/input/regression/auto-beam.ly:1.30 Mon Aug 22 17:28:50 2005
+++ lilypond/input/regression/auto-beam.ly      Sun Oct 16 13:52:41 2005
@@ -3,7 +3,7 @@
 beam."
 }
 
-\version "2.6.0"
+\version "2.7.13"
 
 \layout  {
   raggedright = ##t 
Index: lilypond/input/regression/auto-change.ly
diff -u lilypond/input/regression/auto-change.ly:1.38 
lilypond/input/regression/auto-change.ly:1.39
--- lilypond/input/regression/auto-change.ly:1.38       Mon Aug 22 17:28:50 2005
+++ lilypond/input/regression/auto-change.ly    Sun Oct 16 13:52:42 2005
@@ -1,5 +1,5 @@
 
-\version "2.6.0"
+\version "2.7.13"
 
 \header {
 
Index: lilypond/input/regression/backend-excercise.ly
diff -u lilypond/input/regression/backend-excercise.ly:1.6 
lilypond/input/regression/backend-excercise.ly:1.7
--- lilypond/input/regression/backend-excercise.ly:1.6  Sun Jun 26 22:39:13 2005
+++ lilypond/input/regression/backend-excercise.ly      Sun Oct 16 13:52:42 2005
@@ -2,7 +2,7 @@
   texidoc = "Excercise all output functions"
 }
 
-\version "2.6.0"
+\version "2.7.13"
 
 \paper { raggedright = ##t }
 
Index: lilypond/lily/bar-line.cc
diff -u lilypond/lily/bar-line.cc:1.61 lilypond/lily/bar-line.cc:1.62
--- lilypond/lily/bar-line.cc:1.61      Sun Oct 16 12:29:40 2005
+++ lilypond/lily/bar-line.cc   Sun Oct 16 13:52:42 2005
@@ -196,5 +196,6 @@
               "hair-thickness "
               "thick-thickness "
               "glyph "
+              "glyph-name "
               "bar-size "
               );
Index: lilypond/lily/grob.cc
diff -u lilypond/lily/grob.cc:1.148 lilypond/lily/grob.cc:1.149
--- lilypond/lily/grob.cc:1.148 Sun Oct 16 11:36:37 2005
+++ lilypond/lily/grob.cc       Sun Oct 16 13:52:42 2005
@@ -732,7 +732,6 @@
               "meta "
               "minimum-X-extent "
               "minimum-Y-extent "
-              "print-function "
               "spacing-procedure "
               "staff-symbol "
               "stencil "
Index: lilypond/lily/include/note-head.hh
diff -u lilypond/lily/include/note-head.hh:1.61 
lilypond/lily/include/note-head.hh:1.62
--- lilypond/lily/include/note-head.hh:1.61     Sun Oct 16 01:06:19 2005
+++ lilypond/lily/include/note-head.hh  Sun Oct 16 13:52:42 2005
@@ -23,6 +23,7 @@
   DECLARE_SCHEME_CALLBACK (brew_ez_stencil, (SCM));
   DECLARE_SCHEME_CALLBACK (extent, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK (stem_x_shift, (SCM, SCM));
+  DECLARE_SCHEME_CALLBACK (calc_stem_attachment, (SCM));
   static bool has_interface (Grob *);
   static Real stem_attachment_coordinate (Grob *, Axis a);
   static int get_balltype (Grob *);
Index: lilypond/lily/ligature-engraver.cc
diff -u lilypond/lily/ligature-engraver.cc:1.51 
lilypond/lily/ligature-engraver.cc:1.52
--- lilypond/lily/ligature-engraver.cc:1.51     Sat Aug 13 21:35:23 2005
+++ lilypond/lily/ligature-engraver.cc  Sun Oct 16 13:52:42 2005
@@ -247,7 +247,7 @@
       primitives_.push (info);
       if (info.grob ())
        {
-         info.grob ()->set_property ("print-function",
+         info.grob ()->set_callback (ly_symbol2scm ("stencil"),
                                      brew_ligature_primitive_proc);
        }
     }
Index: lilypond/lily/line-spanner.cc
diff -u lilypond/lily/line-spanner.cc:1.65 lilypond/lily/line-spanner.cc:1.66
--- lilypond/lily/line-spanner.cc:1.65  Mon Sep 12 23:33:24 2005
+++ lilypond/lily/line-spanner.cc       Sun Oct 16 13:52:42 2005
@@ -95,7 +95,7 @@
       /*
        Can't do suicide, since this mucks up finding the trend.
       */
-      me->set_property ("print-function", SCM_EOL);
+      me->set_property ("transparent", SCM_BOOL_T);
     }
   return SCM_EOL;
 }
Index: lilypond/lily/note-head.cc
diff -u lilypond/lily/note-head.cc:1.155 lilypond/lily/note-head.cc:1.156
--- lilypond/lily/note-head.cc:1.155    Sun Oct 16 01:06:19 2005
+++ lilypond/lily/note-head.cc  Sun Oct 16 13:52:42 2005
@@ -35,14 +35,14 @@
   if (!scm_is_symbol (style))
     style = ly_symbol2scm ("default");
 
-  SCM log = scm_from_int (Note_head::get_balltype (me));
   String suffix = to_string (min (robust_scm2int (me->get_property 
("duration-log"), 2), 2));
   if (style != ly_symbol2scm ("default"))
     {
-      SCM proc = me->get_property ("glyph-name-procedure");
-      if (ly_is_procedure (proc))
-       suffix = ly_scm2string (scm_call_2 (proc, log, style));
+      SCM gn = me->get_property ("glyph-name");
+      if (scm_is_string (gn))
+       suffix = ly_scm2string (gn);
     }
+
   Font_metric *fm = Font_interface::get_default_font (me);
 
   String idx = "noteheads.s" + suffix;
@@ -102,41 +102,44 @@
 Real
 Note_head::stem_attachment_coordinate (Grob *me, Axis a)
 {
-  SCM brewer = me->get_property ("print-function");
+  Offset off = robust_scm2offset (me->get_property ("stem-attachment"),
+                                 Offset (0,0));
+  
+  return off [a];
+}
+
+MAKE_SCHEME_CALLBACK(Note_head, calc_stem_attachment, 1);
+SCM
+Note_head::calc_stem_attachment (SCM smob)
+{
+  Grob *me  = unsmob_grob (smob);
   Font_metric *fm = Font_interface::get_default_font (me);
+  String key;
+  internal_print (me, &key);
 
-  if (brewer == Note_head::print_proc)
+  Offset att;
+  
+  int k = fm->name_to_index (key);
+  if (k >= 0)
     {
-      String key;
-      internal_print (me, &key);
-
-      int k = fm->name_to_index (key);
-      if (k >= 0)
+      Box b = fm->get_indexed_char (k);
+      Offset wxwy = fm->attachment_point (key);
+      for (int i = X_AXIS ; i < NO_AXES; i++)
        {
-         Box b = fm->get_indexed_char (k);
-         Offset wxwy = fm->attachment_point (key);
+         Axis a = Axis (i);
+         
          Interval v = b[a];
          if (!v.is_empty ())
-           return 2 * (wxwy[a] - v.center ()) / v.length ();
+           {
+             att[a] = (2 * (wxwy[a] - v.center ()) / v.length ());
+           }
        }
     }
 
-  /*
-    Fallback
-  */
-  SCM v = me->get_property ("stem-attachment-function");
-  if (!ly_is_procedure (v))
-    return 0.0;
-
-  SCM result = scm_call_2 (v, me->self_scm (), scm_from_int (a));
-  if (!scm_is_pair (result))
-    return 0.0;
-
-  result = (a == X_AXIS) ? scm_car (result) : scm_cdr (result);
-
-  return robust_scm2double (result, 0);
+  return ly_offset2scm (att);
 }
 
+
 int
 Note_head::get_balltype (Grob *me)
 {
@@ -151,6 +154,7 @@
               "note-names "
               "glyph-name-procedure "
               "accidental-grob "
+              "stem-attachment"
               "style "
-              "stem-attachment-function");
+              );
 
Index: lilypond/lily/stem.cc
diff -u lilypond/lily/stem.cc:1.281 lilypond/lily/stem.cc:1.282
--- lilypond/lily/stem.cc:1.281 Sun Oct 16 13:28:20 2005
+++ lilypond/lily/stem.cc       Sun Oct 16 13:52:42 2005
@@ -938,6 +938,7 @@
               "avoid-note-head "
               "beam "
               "beaming "
+              "details "
               "direction "
               "duration-log "
               "flag-style "
Index: lilypond/scm/define-grob-properties.scm
diff -u lilypond/scm/define-grob-properties.scm:1.128 
lilypond/scm/define-grob-properties.scm:1.129
--- lilypond/scm/define-grob-properties.scm:1.128       Sun Oct 16 13:28:20 2005
+++ lilypond/scm/define-grob-properties.scm     Sun Oct 16 13:52:42 2005
@@ -252,9 +252,6 @@
      (glyph ,string? "a string determining what (style) of glyph is
 typeset. Valid choices depend on the function that is reading this
 property.")
-     (glyph-name-procedure ,procedure? "Return the name of a character
-within font, to use for printing a symbol.")
-
      (gap ,ly:dimension? "Size of a gap in a variable symbol.")
      (gap-count ,integer? "Number of gapped beams for tremolo.")
      (grace-space-factor ,number? "Space grace notes at this fraction
@@ -365,9 +362,6 @@
                "Pair of staff coordinates @code{(@var{left}
 . @var{right})}, where both @var{left} and @var{right} are in the
 staff-space unit of the current staff.")
-     (print-function ,procedure? "Function taking grob as argument,
-returning a @code{Stencil} object.")
-     
      (ratio ,number? "Parameter for slur shape. The higher this number, the
 quicker the slur attains it @code{height-limit}.")
      (remove-first ,boolean? "Remove the first staff of a orchestral score?")
@@ -426,11 +420,7 @@
 staff spaces, counted from the middle line.")
      
      (stemlet-length ,number? "How long should a stem over a rest be?")
-     (stem-attachment-function ,procedure? "A function that calculates
-where a stem attaches to the note head? This is a fallback when this
-information is not specified in the font.  The function takes a grob
-and axis argument, and returns a (@var{x} . @var{y}) pair, specifying
-location in terms of note head bounding box.")
+     (stem-attachment ,number-pair? "A  (@var{x} . @var{y}) pair where the 
stem attaches to the notehead.")
 
      (stem-end-position ,number? "Where does the stem end (the end is opposite 
to the support-head.")
 
Index: lilypond/scm/define-grobs.scm
diff -u lilypond/scm/define-grobs.scm:1.251 lilypond/scm/define-grobs.scm:1.252
--- lilypond/scm/define-grobs.scm:1.251 Sun Oct 16 13:28:20 2005
+++ lilypond/scm/define-grobs.scm       Sun Oct 16 13:52:42 2005
@@ -109,8 +109,9 @@
     (AmbitusNoteHead
      . (
        (duration-log . 2)
-       (callbacks . (  (stencil . ,Note_head::print)))
-       (glyph-name-procedure . ,find-notehead-symbol)
+       (callbacks . ((stencil . ,Note_head::print)
+                     (glyph-name . ,note-head::calc-glyph-name)
+                     ))
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (meta . ((class . Item)
                 (interfaces . (font-interface
@@ -959,12 +960,15 @@
 
     (NoteHead
      . (
-       (callbacks . ((stencil . ,Note_head::print)))
+       (callbacks . ((stencil . ,Note_head::print)
+                     (stem-attachment . ,Note_head::calc_stem_attachment)
+                     (glyph-name . ,note-head::calc-glyph-name) 
+                     ))
+
+       ;; WTF is this? 
        (ligature-primitive-callback . ,Note_head::print)
-       (glyph-name-procedure . ,find-notehead-symbol)
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (X-offset-callbacks . (,Note_head::stem_x_shift))
-       (stem-attachment-function . ,note-head-style->attachment-coordinates)
        (meta . ((class . Item)
                 (interfaces . (rhythmic-grob-interface
                                rhythmic-head-interface
@@ -1502,7 +1506,7 @@
        (callbacks . ((stencil . ,Text_interface::print)))
        (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
        (font-size . -2)
-       (stem-attachment-function . ,tablature-stem-attachment-function)
+       (stem-attachment . (1.0 . 1.35))
        (font-series . bold)
        (meta . ((class . Item)
                 (interfaces
Index: lilypond/scm/output-lib.scm
diff -u lilypond/scm/output-lib.scm:1.87 lilypond/scm/output-lib.scm:1.88
--- lilypond/scm/output-lib.scm:1.87    Sun Oct 16 12:29:40 2005
+++ lilypond/scm/output-lib.scm Sun Oct 16 13:52:42 2005
@@ -9,7 +9,7 @@
 ;;; Tablature functions, by Jiba ([EMAIL PROTECTED])
 
 ;; The TabNoteHead stem attachment function.
-(define (tablature-stem-attachment-function style duration)
+(define (note-head::calc-tablature-stem-attachment grob)
   (cons 0.0 1.35))
 
 ;; The TabNoteHead tablatureFormat callback.
@@ -110,41 +110,45 @@
 
 
 ;; silly, use alist? 
-(define-public (find-notehead-symbol duration style)
-  (case style
-    ((xcircle) "2xcircle")
-    ((harmonic) "0harmonic")
-    ((baroque) 
-     ;; Oops, I actually would not call this "baroque", but, for
-     ;; backwards compatibility to 1.4, this is supposed to take
-     ;; brevis, longa and maxima from the neo-mensural font and all
-     ;; other note heads from the default font.  -- jr
-     (if (< duration 0)
-        (string-append (number->string duration) "neomensural")
-        (number->string duration)))
-    ((mensural)
-     (string-append (number->string duration) (symbol->string style)))
-    ((petrucci)
-     (if (< duration 0)
-        (string-append (number->string duration) "mensural")
-        (string-append (number->string duration) (symbol->string style))))
-    ((neomensural)
-     (string-append (number->string duration) (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 (< duration -1)
-        (string-append (number->string duration) "neomensural")
-        (number->string duration)))
-    (else
-     (if (string-match "vaticana*|hufnagel*|medicaea*" (symbol->string style))
-        (symbol->string style)
-        (string-append (number->string (max 0 duration))
-                       (symbol->string style))))))
+(define-public (note-head::calc-glyph-name grob)
+  (let*
+      ((style (ly:grob-property grob 'style))
+       (log (min 2 (ly:grob-property grob 'duration-log))))
+    
+    (case style
+      ((xcircle) "2xcircle")
+      ((harmonic) "0harmonic")
+      ((baroque) 
+       ;; Oops, I actually would not call this "baroque", but, for
+       ;; backwards compatibility to 1.4, this is supposed to take
+       ;; brevis, longa and maxima from the neo-mensural font and all
+       ;; other note heads from the default font.  -- jr
+       (if (< log 0)
+          (string-append (number->string log) "neomensural")
+          (number->string log)))
+      ((mensural)
+       (string-append (number->string log) (symbol->string style)))
+      ((petrucci)
+       (if (< log 0)
+          (string-append (number->string log) "mensural")
+          (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)
+          (string-append (number->string (max 0 log))
+                         (symbol->string style)))))))
 
 ;; TODO junk completely?
 (define (note-head-style->attachment-coordinates grob axis)


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to