X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fvaticana-ligature.cc;h=9e97482d029d2779e1cd427d6a10c9be0eb7a96c;hb=bafb860e63923b4ad621168b0aa14d189c7a76fc;hp=fd73f5405a3c0044c631685f3ee250927d5eb3e5;hpb=57be7394ffa2e7d7ba6d60548dba563f3409d472;p=lilypond.git diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index fd73f5405a..9e97482d02 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -3,20 +3,19 @@ source file of the GNU LilyPond music typesetter - (c) 2003--2005 Juergen Reuter + (c) 2003--2006 Juergen Reuter */ #include "vaticana-ligature.hh" -#include - -#include "item.hh" +#include "bezier.hh" #include "font-interface.hh" +#include "international.hh" +#include "item.hh" #include "lookup.hh" -#include "staff-symbol-referencer.hh" #include "note-head.hh" #include "output-def.hh" -#include "bezier.hh" +#include "staff-symbol-referencer.hh" #include "warn.hh" Stencil @@ -26,7 +25,7 @@ vaticana_brew_cauda (Grob *me, Real thickness, Real blotdiameter) { - bool on_staffline = Staff_symbol_referencer::on_staffline (me, pos); + bool on_staffline = Staff_symbol_referencer::on_line (me, pos); int interspaces = Staff_symbol_referencer::line_count (me) - 1; bool above_staff = pos > interspaces; @@ -78,9 +77,7 @@ vaticana_brew_flexa (Grob *me, Real interval; SCM flexa_height_scm = me->get_property ("flexa-height"); if (flexa_height_scm != SCM_EOL) - { - interval = scm_to_int (flexa_height_scm); - } + interval = scm_to_int (flexa_height_scm); else { me->warning ("Vaticana_ligature: " @@ -89,9 +86,7 @@ vaticana_brew_flexa (Grob *me, } if (interval >= 0.0) - { - me->warning (_ ("ascending vaticana style flexa")); - } + me->warning (_ ("ascending vaticana style flexa")); Real width = robust_scm2double (me->get_property ("flexa-width"), 2); @@ -181,7 +176,7 @@ vaticana_brew_join (Grob *me, int delta_pitch, { me->programming_error (_f ("Vaticana_ligature: " "zero join (delta_pitch == 0)")); - return Stencil (); + return Lookup::blank (Box (Interval (0, 0), Interval (0, 0))); } Interval x_extent = Interval (0, join_thickness); Interval y_extent = (delta_pitch > 0) @@ -199,23 +194,23 @@ vaticana_brew_primitive (Grob *me) { me->programming_error ("Vaticana_ligature: " "undefined glyph-name -> ignoring grob"); - return Stencil (); + return Lookup::blank (Box (Interval (0, 0), Interval (0, 0))); } - String glyph_name = ly_scm2string (glyph_name_scm); + string glyph_name = ly_scm2string (glyph_name_scm); Stencil out; Real thickness = robust_scm2double (me->get_property ("thickness"), 1); Real line_thickness - = thickness * me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness")); + = thickness * me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); Real blotdiameter - = (me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"))); + = (me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"))); int pos = Staff_symbol_referencer::get_rounded_position (me); - SCM delta_pitch_scm = me->get_property ("delta-pitch"); + SCM delta_pitch_scm = me->get_property ("delta-position"); int delta_pitch; if (delta_pitch_scm != SCM_EOL) delta_pitch = scm_to_int (delta_pitch_scm); @@ -228,7 +223,7 @@ vaticana_brew_primitive (Grob *me) bool add_cauda = to_boolean (me->get_property ("add-cauda")); bool add_join = to_boolean (me->get_property ("add-join")); - if (!String::compare (glyph_name, "")) + if (glyph_name == "") { /* * This is an empty head. This typically applies for the right @@ -242,15 +237,13 @@ vaticana_brew_primitive (Grob *me) out = Lookup::blank (Box (Interval (0, 0.5 * flexa_width), Interval (0, 0))); } - else if (!String::compare (glyph_name, "flexa")) - { - out = vaticana_brew_flexa (me, true, line_thickness); - } + else if (glyph_name == "flexa") + out = vaticana_brew_flexa (me, true, line_thickness); else { out = Font_interface::get_default_font (me)-> - find_by_name ("noteheads." + glyph_name); + find_by_name ("noteheads.s" + glyph_name); } out.translate_axis (x_offset, X_AXIS); Real head_width = out.extent (X_AXIS).length (); @@ -299,8 +292,17 @@ Vaticana_ligature::print (SCM) return SCM_EOL; } -ADD_INTERFACE (Vaticana_ligature, "vaticana-ligature-interface", +ADD_INTERFACE (Vaticana_ligature, "A vaticana style gregorian ligature", - "glyph-name flexa-height flexa-width thickness add-cauda " - "add-stem add-join delta-pitch x-offset " - "ligature-primitive-callback"); + + /* properties */ + "glyph-name " + "flexa-height " + "flexa-width " + "thickness " + "add-cauda " + "add-stem " + "add-join " + "delta-position " + "x-offset " + );