From: Han-Wen Nienhuys Date: Thu, 10 Mar 2005 15:05:07 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.5.15~12 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f2541abbfdbed6bf32db3b7eaa62baae33710b04;p=lilypond.git *** empty log message *** --- diff --git a/lily/accidental.cc b/lily/accidental.cc index 6522a843cd..3d1f6270dc 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -131,128 +131,128 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common) /* - * Some styles do not provide all flavours of accidentals, e.g. there - * is currently no sharp accidental in vaticana style. In these cases - * this function falls back to one of the other styles. - */ + * Some styles do not provide all flavours of accidentals, e.g. there + * is currently no sharp accidental in vaticana style. In these cases + * this function falls back to one of the other styles. + */ - /* - todo: this sort of stuff in Scheme. --hwn. - */ - String - Accidental_interface::get_fontcharname (String style, int alteration) - { - if (alteration == DOUBLE_FLAT - || alteration == DOUBLE_SHARP) - { - return to_string (alteration); - } +/* + todo: this sort of stuff in Scheme. --hwn. +*/ +String +Accidental_interface::get_fontcharname (String style, int alteration) +{ + if (alteration == DOUBLE_FLAT + || alteration == DOUBLE_SHARP) + { + return to_string (alteration); + } - if (style == "hufnagel") - switch (alteration) - { - case FLAT: return "hufnagel-1"; - case 0: return "vaticana0"; - case SHARP: return "mensural1"; - } - if (style == "medicaea") - switch (alteration) - { - case FLAT: return "medicaea-1"; - case 0: return "vaticana0"; - case SHARP: return "mensural1"; - } - if (style == "vaticana") - switch (alteration) - { - case FLAT: return "vaticana-1"; - case 0: return "vaticana0"; - case SHARP: return "mensural1"; - } - if (style == "mensural") - switch (alteration) - { - case FLAT: return "mensural-1"; - case 0: return "vaticana0"; - case SHARP: return "mensural1"; - } - - if (style == "neomensural") - style = ""; // currently same as default - if (style == "default") - style = ""; - return style + to_string (alteration); + if (style == "hufnagel") + switch (alteration) + { + case FLAT: return "hufnagel-1"; + case 0: return "vaticana0"; + case SHARP: return "mensural1"; } - - MAKE_SCHEME_CALLBACK (Accidental_interface, print, 1); - SCM - Accidental_interface::print (SCM smob) + if (style == "medicaea") + switch (alteration) + { + case FLAT: return "medicaea-1"; + case 0: return "vaticana0"; + case SHARP: return "mensural1"; + } + if (style == "vaticana") + switch (alteration) + { + case FLAT: return "vaticana-1"; + case 0: return "vaticana0"; + case SHARP: return "mensural1"; + } + if (style == "mensural") + switch (alteration) { - Grob *me = unsmob_grob (smob); - bool smaller = false; - bool parens = false; + case FLAT: return "mensural-1"; + case 0: return "vaticana0"; + case SHARP: return "mensural1"; + } - bool caut = to_boolean (me->get_property ("cautionary")); - if (caut) - { - SCM cstyle = me->get_property ("cautionary-style"); - parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses")); - smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller")); - } + if (style == "neomensural") + style = ""; // currently same as default + if (style == "default") + style = ""; + return style + to_string (alteration); +} - SCM scm_style = me->get_property ("style"); - String style; - if (scm_is_symbol (scm_style)) - { - style = ly_symbol2string (scm_style); - } - else - { - /* - preferably no name for the default style. - */ - style = ""; - } +MAKE_SCHEME_CALLBACK (Accidental_interface, print, 1); +SCM +Accidental_interface::print (SCM smob) +{ + Grob *me = unsmob_grob (smob); + bool smaller = false; + bool parens = false; - Font_metric *fm = 0; - if (smaller) - { - SCM ac = Font_interface::music_font_alist_chain (me); - /* - TODO: should calc font-size by adding -2 to current font-size - */ - ac = scm_cons (scm_list_1 (scm_cons - (ly_symbol2scm ("font-size"), - scm_int2num (-2))), - ac); - fm = select_font (me->get_layout (), ac); - } - else - fm = Font_interface::get_default_font (me); + bool caut = to_boolean (me->get_property ("cautionary")); + if (caut) + { + SCM cstyle = me->get_property ("cautionary-style"); + parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses")); + smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller")); + } - Stencil mol; - for (SCM s = me->get_property ("accidentals"); - scm_is_pair (s); s = scm_cdr (s)) - { - int alteration = scm_to_int (scm_car (s)); - String font_char = get_fontcharname (style, alteration); - Stencil acc (fm->find_by_name ("accidentals." + font_char)); - - if (acc.is_empty ()) - { - me->warning (_f ("accidental `%s' not found", font_char)); - } - else - { - mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1, 0); - } - } + SCM scm_style = me->get_property ("style"); + String style; + if (scm_is_symbol (scm_style)) + { + style = ly_symbol2string (scm_style); + } + else + { + /* + preferably no name for the default style. + */ + style = ""; + } - if (parens) - mol = parenthesize (me, mol); + Font_metric *fm = 0; + if (smaller) + { + SCM ac = Font_interface::music_font_alist_chain (me); + /* + TODO: should calc font-size by adding -2 to current font-size + */ + ac = scm_cons (scm_list_1 (scm_cons + (ly_symbol2scm ("font-size"), + scm_int2num (-2))), + ac); + fm = select_font (me->get_layout (), ac); + } + else + fm = Font_interface::get_default_font (me); - return mol.smobbed_copy (); - } + Stencil mol; + for (SCM s = me->get_property ("accidentals"); + scm_is_pair (s); s = scm_cdr (s)) + { + int alteration = scm_to_int (scm_car (s)); + String font_char = get_fontcharname (style, alteration); + Stencil acc (fm->find_by_name ("accidentals." + font_char)); + + if (acc.is_empty ()) + { + me->warning (_f ("accidental `%s' not found", font_char)); + } + else + { + mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1, 0); + } + } + + if (parens) + mol = parenthesize (me, mol); + + return mol.smobbed_copy (); +} /* TODO: should move inside-slur into item? diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc index 186f976fd7..76b5eb4dd3 100644 --- a/lily/ledger-line-spanner.cc +++ b/lily/ledger-line-spanner.cc @@ -147,7 +147,7 @@ Ledger_line_spanner::set_spacing_rods (SCM smob) Direction d = DOWN; do { - if (!extents_right[d].is_empty () && !extents_right[d].is_empty ()) + if (!extents_left[d].is_empty () && !extents_right[d].is_empty ()) { Real l1 = extents_right[d].length () * min_length_fraction; Real l2 = extents_left[d].length () * min_length_fraction; diff --git a/lily/spanner.cc b/lily/spanner.cc index 0a72592b32..e7221000c7 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -10,7 +10,7 @@ #include -#include +#include #include "warn.hh" #include "paper-column.hh" diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 4ef10f4e08..826ffe17aa 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -8,7 +8,7 @@ #include -#include // isinf +#include // isinf #include "font-metric.hh" #include "stencil.hh" diff --git a/lily/stencil.cc b/lily/stencil.cc index 0c314964ae..5e102dd5fc 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -10,7 +10,7 @@ #include -#include // isinf +#include // isinf #include "input-smob.hh" #include "font-metric.hh"