Index: lily/gregorian-ligature-engraver.cc =================================================================== RCS file: /cvsroot/lilypond/lilypond/lily/gregorian-ligature-engraver.cc,v retrieving revision 1.1 diff -u -r1.1 gregorian-ligature-engraver.cc --- lily/gregorian-ligature-engraver.cc 7 Jan 2003 20:07:26 -0000 1.1 +++ lily/gregorian-ligature-engraver.cc 8 Jan 2003 18:45:08 -0000 @@ -307,3 +307,12 @@ /* 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: lily/vaticana-ligature-engraver.cc =================================================================== RCS file: /cvsroot/lilypond/lilypond/lily/vaticana-ligature-engraver.cc,v retrieving revision 1.1 diff -u -r1.1 vaticana-ligature-engraver.cc --- lily/vaticana-ligature-engraver.cc 7 Jan 2003 20:07:26 -0000 1.1 +++ lily/vaticana-ligature-engraver.cc 8 Jan 2003 18:45:08 -0000 @@ -23,7 +23,7 @@ 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 @@ 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 @@ { 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 @@ * 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 @@ 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 (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 @@ * 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 @@ 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 @@ } 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 @@ */ 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: lily/vaticana-ligature.cc =================================================================== RCS file: /cvsroot/lilypond/lilypond/lily/vaticana-ligature.cc,v retrieving revision 1.1 diff -u -r1.1 vaticana-ligature.cc --- lily/vaticana-ligature.cc 7 Jan 2003 20:07:26 -0000 1.1 +++ lily/vaticana-ligature.cc 8 Jan 2003 18:45:08 -0000 @@ -160,16 +160,16 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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: scm/grob-property-description.scm =================================================================== RCS file: /cvsroot/lilypond/lilypond/scm/grob-property-description.scm,v retrieving revision 1.134 diff -u -r1.134 grob-property-description.scm --- scm/grob-property-description.scm 7 Jan 2003 20:07:26 -0000 1.134 +++ scm/grob-property-description.scm 8 Jan 2003 18:45:08 -0000 @@ -377,6 +377,8 @@ (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 @@ (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 @@ -- 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 @@ (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.")