]> git.donarmstrong.com Git - lilypond.git/commitdiff
JR patches.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 8 Jan 2003 22:50:15 +0000 (22:50 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 8 Jan 2003 22:50:15 +0000 (22:50 +0000)
ChangeLog
lily/gregorian-ligature-engraver.cc
lily/vaticana-ligature-engraver.cc
lily/vaticana-ligature.cc
scm/grob-property-description.scm

index de74412aa451c4e0f7d71fc16e0831498776074b..0afce2645c2a3b3ea194731ea98a9c862c669d80 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+       
+2002-01-08  Juergen Reuter  <reuter@ipd.uka.de>
+
+       * lily/gregorian-ligature-engraver.cc: bugfix: added missing
+       interfaces for (abstract) grob GregorianLigature
+
+       * lily/vaticana-ligature-engraver.cc, lily/vaticana-ligature.cc:
+       renamed head* -> glyph_name*, x-shift* -> x-offset*
+
+       * scm/grob-property-description.scm: bugfix: added missing descriptions
+
 2003-01-07  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * input/test/chord-names-dpnj.ly: New file.
@@ -11,7 +22,7 @@
        (double-plus-new-chord->markup): Fix sub->markup.
 
 
-2003-01-07  Juergen Reuter  <reuter@ipd.uka.de>
+g2003-01-07  Juergen Reuter  <reuter@ipd.uka.de>
 
        * lily/custos-engraver.cc: added TODO; editorial changes
 
index f3ba8b9ba4ea0cf4939eacc69130d5edbf3cf553..12ec008a7929b63ba2ac44142891b6beb9dfe5b2 100644 (file)
@@ -307,3 +307,12 @@ ENTER_DESCRIPTION (Gregorian_ligature_engraver,
 /* acks  */      "ligature-head-interface note-head-interface rest-interface",
 /* reads */       "",
 /* write */       "");
+
+class Gregorian_ligature {
+public:
+  static bool has_interface (Grob *);
+};
+ADD_INTERFACE (Gregorian_ligature, "gregorian-ligature-interface",
+              "A gregorian ligature",
+              "virga stropha inclinatum auctum descendens ascendens "
+              "pes-or-flexa semivocalis oriscus quilisma deminutum");
index 69bf875c9a2d36c9dc3482995858f3f79ef1f949..8445d2c7fbf25a5ad8efbf281235d513bc7209a9 100644 (file)
@@ -23,7 +23,7 @@ private:
   Real finish_primitive (Item *first_primitive,
                         Item *primitive,
                         int context_info,
-                        String head,
+                        String glyph_name,
                         int pitch_delta,
                         Real flexa_width,
                         Real join_thickness,
@@ -52,7 +52,7 @@ Real
 Vaticana_ligature_engraver::finish_primitive (Item *first_primitive,
                                              Item *primitive,
                                              int context_info,
-                                             String head,
+                                             String glyph_name,
                                              int pitch_delta,
                                              Real flexa_width,
                                              Real join_thickness,
@@ -60,14 +60,14 @@ Vaticana_ligature_engraver::finish_primitive (Item *first_primitive,
 {
   if (primitive)
     {
-      // determine width of previous head and x-shift
+      // determine width of previous head and x-offset
       Real head_width;
-      Real x_shift;
+      Real x_offset;
       bool is_stacked;
       is_stacked = context_info & PES_UPPER;
       if (context_info & FLEXA_LEFT)
        is_stacked = false;
-      if (!String::compare (head, "vaticana_cephalicus") &&
+      if (!String::compare (glyph_name, "vaticana_cephalicus") &&
          !(context_info & PES_LOWER))
        is_stacked = true;
       if (context_info & AUCTUM)
@@ -82,35 +82,35 @@ Vaticana_ligature_engraver::finish_primitive (Item *first_primitive,
           * and the other head are horizontally aligned.
           */
          head_width = 0.0;
-         x_shift = join_thickness -
+         x_offset = join_thickness -
            Font_interface::get_default_font (primitive)->
-           find_by_name ("noteheads-" + head).extent (X_AXIS).length ();
+           find_by_name ("noteheads-" + glyph_name).extent (X_AXIS).length ();
        }
-      else if (!String::compare (head, "porrectus") ||
-              !String::compare (head, ""))
+      else if (!String::compare (glyph_name, "porrectus") ||
+              !String::compare (glyph_name, ""))
        {
          /*
           * This head represents either half of a porrectus shape.
           * Hence, it is assigned half the width of this shape.
           */
          head_width = 0.5 * flexa_width;
-         x_shift = 0.0;
+         x_offset = 0.0;
        }
       else // retrieve width from corresponding font
        {
          head_width =
            Font_interface::get_default_font (primitive)->
-           find_by_name ("noteheads-" + head).extent (X_AXIS).length ();
-         x_shift = 0.0;
+           find_by_name ("noteheads-" + glyph_name).extent (X_AXIS).length ();
+         x_offset = 0.0;
        }
 
       /*
-       * Save the head's final shape and x-shift.
+       * Save the head's final shape and x-offset.
        */
-      primitive->set_grob_property ("ligature-head",
-                                   ly_symbol2scm (head.to_str0 ()));
-      primitive->set_grob_property ("x-shift",
-                                   gh_double2scm (x_shift));
+      primitive->set_grob_property ("glyph-name",
+                                   ly_symbol2scm (glyph_name.to_str0 ()));
+      primitive->set_grob_property ("x-offset",
+                                   gh_double2scm (x_offset));
 
       /*
        * If the head is the 2nd head of a pes or flexa (but not a
@@ -186,14 +186,14 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
   int prev_context_info = 0;
   int prev_pitch = 0;
   int prev_pitch_delta = 0;
-  String prev_head = "";
+  String prev_glyph_name = "";
   Real prev_distance = 0.0;
   for (int i = 0; i < primitives.size(); i++) {
     Item *primitive = dynamic_cast<Item*> (primitives[i].grob_);
     Music *music_cause = primitives[i].music_cause ();
     int context_info = gh_scm2int (primitive->get_grob_property ("context-info"));
     int pitch = unsmob_pitch (music_cause->get_mus_property ("pitch"))->steps ();
-    String head;
+    String glyph_name;
     if (!first_primitive)
       first_primitive = primitive;
     int prefix_set = gh_scm2int (primitive->get_grob_property ("prefix-set"));
@@ -205,51 +205,51 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
      * the backend).
      */
     if (prefix_set & VIRGA)
-      head = "vaticana_virga";
+      glyph_name = "vaticana_virga";
     else if (prefix_set & QUILISMA)
-      head = "vaticana_quilisma";
+      glyph_name = "vaticana_quilisma";
     else if (prefix_set & ORISCUS)
-      head = "solesmes_oriscus";
+      glyph_name = "solesmes_oriscus";
     else if (prefix_set & STROPHA)
       if (prefix_set & AUCTUM)
-       head = "solesmes_stropha_aucta";
-      else head = "solesmes_stropha";
+       glyph_name = "solesmes_stropha_aucta";
+      else glyph_name = "solesmes_stropha";
     else if (prefix_set & SEMIVOCALIS)
       if (pitch > prev_pitch)
-       head = "vaticana_epiphonus";
-      else head = "vaticana_cephalicus";
+       glyph_name = "vaticana_epiphonus";
+      else glyph_name = "vaticana_cephalicus";
     else if (prefix_set & INCLINATUM)
       if (prefix_set & AUCTUM)
-       head = "solesmes_incl_auctum";
+       glyph_name = "solesmes_incl_auctum";
       else if (prefix_set & DEMINUTUM)
-       head = "solesmes_incl_parvum";
+       glyph_name = "solesmes_incl_parvum";
       else
-       head = "vaticana_inclinatum";
+       glyph_name = "vaticana_inclinatum";
     else if (prefix_set & (CAVUM | LINEA))
       if ((prefix_set & CAVUM) && (prefix_set & LINEA))
-       head = "vaticana_linea_punctum_cavum";
+       glyph_name = "vaticana_linea_punctum_cavum";
       else if (prefix_set & CAVUM)
-       head = "vaticana_punctum_cavum";
+       glyph_name = "vaticana_punctum_cavum";
       else
-       head = "vaticana_linea_punctum";
+       glyph_name = "vaticana_linea_punctum";
     else if (prefix_set & AUCTUM)
       if (prefix_set & ASCENDENS)
-       head = "solesmes_auct_asc";
+       glyph_name = "solesmes_auct_asc";
       else
-       head = "solesmes_auct_desc";
+       glyph_name = "solesmes_auct_desc";
     else if (prefix_set & DEMINUTUM)
-      head = "vaticana_plica";
+      glyph_name = "vaticana_plica";
     else if ((prefix_set & PES_OR_FLEXA) &&
             (context_info & PES_LOWER) &&
             (context_info & FLEXA_RIGHT))
-      head = ""; // second head of porrectus
+      glyph_name = ""; // second head of porrectus
     else if (context_info & PES_UPPER)
       if (pitch - prev_pitch > 1)
-       head = "vaticana_upes";
+       glyph_name = "vaticana_upes";
       else
-       head = "vaticana_vupes";
+       glyph_name = "vaticana_vupes";
     else
-      head = "vaticana_punctum";
+      glyph_name = "vaticana_punctum";
 
     /*
      * May need updating previous head, depending on the current head.
@@ -258,7 +258,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
       if ((context_info & PES_LOWER) &&
          (context_info & FLEXA_RIGHT)) // porrectus
        {
-         prev_head = "porrectus";
+         prev_glyph_name = "porrectus";
          prev_primitive->set_grob_property ("porrectus-height",
                                             gh_int2scm (pitch - prev_pitch));
          prev_primitive->set_grob_property ("porrectus-width",
@@ -271,13 +271,13 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
        }
       else if (context_info & PES_UPPER)
        {
-         if (!String::compare (prev_head, "vaticana_punctum"))
-           prev_head = "vaticana_lpes";
+         if (!String::compare (prev_glyph_name, "vaticana_punctum"))
+           prev_glyph_name = "vaticana_lpes";
        }
       else // flexa
        {
-         if (!String::compare (prev_head, "vaticana_punctum"))
-           prev_head = "vaticana_rvirga";
+         if (!String::compare (prev_glyph_name, "vaticana_punctum"))
+           prev_glyph_name = "vaticana_rvirga";
        }
 
     /*
@@ -300,21 +300,21 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
      */
     prev_distance =
       finish_primitive (first_primitive, prev_primitive,
-                       prev_context_info, prev_head, prev_pitch_delta,
+                       prev_context_info, prev_glyph_name, prev_pitch_delta,
                        flexa_width, join_thickness, prev_distance);
 
     prev_primitive = primitive;
     prev_context_info = context_info;
     prev_pitch_delta = pitch - prev_pitch;
     prev_pitch = pitch;
-    prev_head = head;
+    prev_glyph_name = glyph_name;
   }
 
   /*
    * Finish head of last iteration for backend.
    */
   finish_primitive (first_primitive, prev_primitive,
-                   prev_context_info, prev_head, prev_pitch_delta,
+                   prev_context_info, prev_glyph_name, prev_pitch_delta,
                    flexa_width, join_thickness, prev_distance);
 }
 
index 1fe4e19dc0cd4af7ea6e0ee80d4c2ab35c841111..22abd222d6215db2fb5a92cb603efac4ab78b23f 100644 (file)
@@ -160,16 +160,16 @@ vaticana_add_ledger_lines (Grob *me, Molecule *out, int pos, Real offs,
 Molecule
 vaticana_brew_primitive (Grob *me, bool ledger_take_space)
 {
-  SCM head_scm = me->get_grob_property ("ligature-head");
-  if (head_scm == SCM_EOL)
+  SCM glyph_name_scm = me->get_grob_property ("glyph-name");
+  if (glyph_name_scm == SCM_EOL)
     {
       programming_error ("Vaticana_ligature:"
-                        "undefined ligature-head -> ignoring grob");
+                        "undefined glyph-name -> ignoring grob");
       return Molecule ();
     }
 
-  String head = ly_symbol2string (head_scm);
-  if (!String::compare (head, ""))
+  String glyph_name = ly_symbol2string (glyph_name_scm);
+  if (!String::compare (glyph_name, ""))
     {
       // empty head (typically, this is the right side of porrectus
       // shape, which is already typeset by the associated left side
@@ -196,20 +196,20 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space)
       thickness = 1.4 * me->get_paper ()->get_var ("linethickness");
     }
 
-  Real x_shift = 0.0;
-  SCM x_shift_scm = me->get_grob_property ("x-shift");
-  if (x_shift_scm != SCM_EOL)
+  Real x_offset = 0.0;
+  SCM x_offset_scm = me->get_grob_property ("x-offset");
+  if (x_offset_scm != SCM_EOL)
     {
-      x_shift = gh_scm2double (x_shift_scm);
+      x_offset = gh_scm2double (x_offset_scm);
     }
   else
     {
       programming_error (_f ("Vaticana_ligature:"
-                            "x-shift undefined; assuming 0.0",
+                            "x-offset undefined; assuming 0.0",
                             me));
     }
 
-  if (!String::compare (head, "porrectus"))
+  if (!String::compare (glyph_name, "porrectus"))
     {
       SCM porrectus_height_scm = me->get_grob_property ("porrectus-height");
       if (porrectus_height_scm != SCM_EOL)
@@ -240,8 +240,10 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space)
     }
   else
     {
-      Molecule mol = Font_interface::get_default_font (me)->find_by_name ("noteheads-" + head);
-      mol.translate_axis (x_shift, X_AXIS);
+      Molecule mol =
+       Font_interface::get_default_font (me)->
+       find_by_name ("noteheads-" + glyph_name);
+      mol.translate_axis (x_offset, X_AXIS);
       out.add_molecule (mol);
     }
 
@@ -265,7 +267,7 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space)
 
   int pos = (int)rint (Staff_symbol_referencer::get_position (me));
   vaticana_add_ledger_lines(me, &out, pos, 0, ledger_take_space);
-  if (!String::compare (head, "porrectus"))
+  if (!String::compare (glyph_name, "porrectus"))
     {
       pos += porrectus_height;
       vaticana_add_ledger_lines(me, &out, pos, 0.5*porrectus_height, ledger_take_space);
@@ -292,5 +294,5 @@ Vaticana_ligature::brew_molecule (SCM)
 
 ADD_INTERFACE (Vaticana_ligature, "vaticana-ligature-interface",
               "A vaticana style gregorian ligature",
-              "ligature-head porrectus-height porrectus-width thickness join-left add-stem x-shift"
-              "ligature-primitive-callback");
+              "glyph-name porrectus-height porrectus-width thickness join-left "
+              "add-stem x-offset ligature-primitive-callback");
index bb569b14eaa68b47f8dab76b6e7cb1586e8284f5..f12e5ca53b1e2b15664e8ee73c2343d61b156e5f 100644 (file)
@@ -377,6 +377,8 @@ as a real penalty.")
 (grob-property-description 'pitches list? "list of musical-pitch.")
 (grob-property-description 'quilisma boolean? "is this neume a quilisma?.")
 (grob-property-description 'positions pair? "cons of staff positions (LEFT . RIGHT")
+(grob-property-description 'porrectus-height number? "in staffspace.")
+(grob-property-description 'porrectus-width number? "in staffspace.")
 (grob-property-description 'raise number? "height for text to be raised (a negative value lowers the text.")
 (grob-property-description 'ratio number? "Slur parameter.  See height-limit.")
 (grob-property-description 'right-padding number? "space right of accs.")
@@ -551,6 +553,7 @@ no extent.
 (grob-property-description 'width number? "width of a grob measured in staff space.")
 (grob-property-description 'width-correct number? "width correction for (de)cresc. text spanners.")
 (grob-property-description 'x-gap number? "horizontal gap between notehead and tie.")
+(grob-property-description 'x-offset number? "extra horizontal offset for ligature heads.")
 (grob-property-description 'y-free number? "minimal vertical gap between slur and noteheads or stems.")
 (grob-property-description 'y-offset number? "extra vertical offset
 for ties away from the center line.")
@@ -604,7 +607,7 @@ staff in a row more often, when the heights of the notes vary.
 -- can be stored for debugging")
 (grob-property-description 'least-squares-dy number? 
  "ideal beam slope, without damping.")
-(grob-property-description 'ligature-primitive-callback procedure? "DOCME")
+(grob-property-description 'ligature-primitive-callback procedure? "callback that brews ligature head.")
 (grob-property-description 'stem-info pair? "caching of stem parameters")
 (grob-property-description 'note-columns pair? "list of NoteColumn grobs.")
 
@@ -612,9 +615,9 @@ staff in a row more often, when the heights of the notes vary.
 (grob-property-description 'grace-space-factor number? "space grace at this fraction of the increment.")
 (grob-property-description 'position-callbacks list? "list of
 functions set spanner positions.")
-(grob-property-description 'join-left number? "DOCME")
+(grob-property-description 'join-left number? "in ligature such as pes and flexa, the length of the vertical joining beam attached to the left side of the head")
 (grob-property-description 'delta-pitch number? "DOCME")
-(grob-property-description 'head-width number? "DOCME")
+(grob-property-description 'head-width number? "width of this ligature head")
 (grob-property-description 'primitive number? "DOCME")
 (grob-property-description 'minimum-beam-collision-distance number?
 "Minimum distance to beam for a rest collision.")