From: fred Date: Wed, 27 Mar 2002 00:01:59 +0000 (+0000) Subject: lilypond-1.3.102 X-Git-Tag: release/1.5.59~1181 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6e941109311f2b7b574da1c632f9e783196e2d95;p=lilypond.git lilypond-1.3.102 --- diff --git a/CHANGES b/CHANGES index 0c45c08fa7..cf3d221a5c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,26 @@ +1.3.101.jcn2 +============ + +* Fixed bracket, and made some other PostScript code fixes. + +* Silly font initialisation fix for paper19 non-feature. + +1.3.101.uu1 +=========== + +* Automatic engraver/property documentation infrastructure. + +* Fixed system-start braces + +* Fix for forgetAccidentals: do print accidentals, just don't remember +them. + +* Bugfix: forced script directions for scripts that have relative stem-direction. + +* Bugfix: Tie_column doesn't force Tie directions ties that already +have a direction. + +* Bugfix: multimeasure rest 1.3.101 ======= diff --git a/lily/font-interface.cc b/lily/font-interface.cc index 01d9c5e1b7..dc6bd81d57 100644 --- a/lily/font-interface.cc +++ b/lily/font-interface.cc @@ -38,19 +38,42 @@ Font_interface::get_default_font (Score_element*me) if (fm) return fm; + fm = get_font (me, font_alist_chain (me)); + me->set_elt_property ("font", fm->self_scm ()); + return fm; +} + +Font_metric * +Font_interface::get_font (Score_element *me, SCM chain) +{ + SCM ss = me->paper_l ()->style_sheet_; SCM proc = gh_cdr (scm_assoc (ly_symbol2scm ("properties-to-font"), ss)); SCM fonts = gh_cdr (scm_assoc (ly_symbol2scm ("fonts"), ss)); - SCM defaults = gh_cdr (scm_assoc (ly_symbol2scm ("font-defaults"), - ss)); assert (gh_procedure_p (proc)); - SCM font_name = gh_call2 (proc, fonts, font_alist_chain (me)); + SCM font_name = gh_call2 (proc, fonts, chain); + + Font_metric *fm = me->paper_l ()->find_font (font_name, 1.0); - fm = me->paper_l ()->find_font (font_name, 1.0); - me->set_elt_property ("font", fm->self_scm ()); return fm; } + +SCM +Font_interface::add_style (Score_element* me, SCM style, SCM chain) +{ + assert (gh_symbol_p (style)); + + SCM sheet = me->paper_l ()->style_sheet_; + + SCM style_alist = gh_cdr (scm_assoc (ly_symbol2scm ("style-alist"), sheet)); + SCM entry = scm_assoc (style, style_alist); + if (gh_pair_p (entry)) + { + chain = gh_cons (gh_cdr (entry), chain); + } + return chain; +} diff --git a/lily/include/font-interface.hh b/lily/include/font-interface.hh index 34f72a6a6b..935d866743 100644 --- a/lily/include/font-interface.hh +++ b/lily/include/font-interface.hh @@ -16,7 +16,9 @@ struct Font_interface { static SCM font_alist_chain (Score_element*); - static Font_metric * get_default_font (Score_element*); + static Font_metric * get_font (Score_element*, SCM alist_chain); + static Font_metric * get_default_font (Score_element*); + static SCM add_style (Score_element*, SCM style, SCM alist_chain); }; #endif /* FONT_INTERFACE_HH */ diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index 507627b5a2..8a021e004b 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -10,6 +10,8 @@ #ifndef TEXT_ITEM #define TEXT_ITEM + +#include "lily-proto.hh" #include "lily-guile.hh" #include "molecule.hh" @@ -20,8 +22,10 @@ public: static Molecule text2molecule (Score_element *me, SCM text, SCM properties); static Molecule string2molecule (Score_element *me, SCM text, SCM properties); static Molecule markup_sentence2molecule (Score_element *me, SCM markup_sentence, SCM properties); - static Molecule lookup_character (Score_element *me, SCM font_name, SCM text); - static Molecule lookup_text (Score_element *me, SCM font_name, SCM char_name); + +private: + static Molecule lookup_character (Score_element *me, Font_metric*, SCM char_name); + static Molecule lookup_text (Score_element *me, Font_metric*, SCM text); }; #endif /* TEXT_ITEM */ diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index 89e1a6f7f4..866e1c2d9b 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -19,10 +19,7 @@ #include "arpeggio.hh" /** - Make accidentals. Catches note heads, ties and notices key-change - events. Due to interaction with ties (which don't come together - with note heads), this needs to be in a context higher than Tie_engraver. - (FIXME). + FIXME: should not compute vertical positioning of accidentals, but get them from the noteheads @@ -81,8 +78,6 @@ Local_key_engraver::process_acknowledged () { SCM localsig = get_property ("localKeySignature"); - SCM f = get_property ("forgetAccidentals"); - bool forget = to_boolean (f); for (int i=0; i < mel_l_arr_.size(); i++) { Score_element * support_l = support_l_arr_[i]; @@ -103,9 +98,7 @@ Local_key_engraver::process_acknowledged () bool different = prev_acc != a; bool tie_changes = tied_l_arr_.find_l (support_l) && different; - if (!forget - && (note_l->forceacc_b_ || different) - && !tie_changes) + if ((note_l->forceacc_b_ || different) && !tie_changes) { if (!key_item_p_) { @@ -137,6 +130,7 @@ Local_key_engraver::process_acknowledged () always do the correct thing? */ + bool forget = to_boolean (get_property ("forgetAccidentals")); if (!forget && !tie_changes) { /* diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index e3748f89f8..16c6a56e57 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -42,6 +42,17 @@ Multi_measure_rest::brew_molecule (SCM smob) { Score_element *me = unsmob_element (smob); Spanner * sp = dynamic_cast (me); + + SCM alist_chain = Font_interface::font_alist_chain (me); + + + SCM style_chain = + Font_interface::add_style (me, ly_symbol2scm ("mmrest-symbol"), + alist_chain); + + Font_metric *musfont + = Font_interface::get_font (me,style_chain); + Real staff_space = Staff_symbol_referencer::staff_space (me); Interval sp_iv; @@ -111,7 +122,7 @@ Multi_measure_rest::brew_molecule (SCM smob) Real pad = s.empty_b () ? 0.0 : gh_scm2double (me->get_elt_property ("padding")) * staff_space; - Molecule r (Font_interface::get_default_font (me)->find_by_name ("rests-" + to_str (k))); + Molecule r (musfont->find_by_name ("rests-" + to_str (k))); if (k == 0) r.translate_axis (staff_space, Y_AXIS); @@ -124,17 +135,16 @@ Multi_measure_rest::brew_molecule (SCM smob) else { String idx = ("rests-") + to_str (-4); - s = Font_interface::get_default_font (me)->find_by_name (idx); + s = musfont->find_by_name (idx); } mol.add_molecule (s); if (measures > 1) { - SCM properties = Font_interface::font_alist_chain (me); Molecule s = Text_item::text2molecule (me, ly_str02scm (to_str (measures).ch_C ()), - properties); + alist_chain); s.align_to (X_AXIS, CENTER); s.translate_axis (3.0 * staff_space, Y_AXIS); mol.add_molecule (s); diff --git a/lily/text-item.cc b/lily/text-item.cc index b9207108a4..3cec390b49 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -88,71 +88,55 @@ Text_item::string2molecule (Score_element *me, SCM text, SCM alist_chain) { SCM style = ly_assoc_chain (ly_symbol2scm ("font-style"), alist_chain); - if (gh_pair_p (style)) - style = gh_cdr (style); - - SCM sheet = me->paper_l ()->style_sheet_; - - if (gh_symbol_p (style)) - { - SCM style_alist = gh_cdr (scm_assoc (ly_symbol2scm ("style-alist"), sheet)); - SCM entry = scm_assoc (style, style_alist); - entry = gh_pair_p (entry) ? gh_cdr (entry) : SCM_EOL; - alist_chain = gh_cons (entry, alist_chain); - } - - SCM fonts = gh_cdr (scm_assoc (ly_symbol2scm ("fonts"), sheet)); - SCM proc = gh_cdr (scm_assoc (ly_symbol2scm ("properties-to-font"), sheet)); - SCM font_name = gh_call2 (proc, fonts, alist_chain); + if (gh_pair_p (style) && gh_symbol_p (gh_cdr (style))) + alist_chain = Font_interface::add_style (me, gh_cdr(style), alist_chain); + Font_metric *fm = Font_interface::get_font (me, alist_chain); + SCM lookup = ly_assoc_chain (ly_symbol2scm ("lookup"), alist_chain); - + Molecule mol; - if (gh_pair_p (lookup) && ly_symbol2string (gh_cdr (lookup)) == "name") - mol = lookup_character (me, font_name, text); + if (gh_pair_p (lookup) && gh_cdr (lookup) ==ly_symbol2scm ("name")) + mol = lookup_character (me, fm, text); else - mol = lookup_text (me, font_name, text); + mol = lookup_text (me, fm, text); return mol; } Molecule -Text_item::lookup_character (Score_element *, SCM font_name, SCM char_name) +Text_item::lookup_character (Score_element *, Font_metric*fm, SCM char_name) { - Adobe_font_metric *afm = all_fonts_global_p->find_afm (ly_scm2string (font_name)); - - if (!afm) - { - warning (_f ("can't find font: `%s'", ly_scm2string (font_name))); - warning (_f ("(search path: `%s')", global_path.str ().ch_C())); - error (_ ("Aborting")); - } - Font_metric * fm = afm; - return fm->find_by_name (ly_scm2string (char_name)); } Molecule -Text_item::lookup_text (Score_element *me, SCM font_name, SCM text) +Text_item::lookup_text (Score_element *me, Font_metric*fm, SCM text) { +#if 0 + /* + Fixme; should be done differently, move to font-interface? + */ + SCM magnification = me->get_elt_property ("font-magnification"); + Font_metric* metric = 0; if (gh_number_p (magnification)) { -#if 0 + Real realmag = pow (1.2, gh_scm2int (magnification)); metric = all_fonts_global_p->find_scaled (ly_scm2string (font_name), realmag); -#endif + assert (false); } - else - metric = me->paper_l ()->find_font (font_name, 1.0); - + +#endif + SCM list = gh_list (ly_symbol2scm ("text"), text, SCM_UNDEFINED); - list = fontify_atom (metric, list); + list = fontify_atom (fm, list); - return Molecule (metric->text_dimension (ly_scm2string (text)), list); + return Molecule (fm->text_dimension (ly_scm2string (text)), list); } Molecule diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index d208b44a10..2d8d6e6e91 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -104,7 +104,6 @@ Volta_engraver::do_process_music () } - end_volta_span_p_ = volta_span_p_; volta_span_p_ = 0; } diff --git a/ly/generate-documentation.ly b/ly/generate-documentation.ly index 03399af21a..924715843e 100644 --- a/ly/generate-documentation.ly +++ b/ly/generate-documentation.ly @@ -1,2 +1,3 @@ -#(eval-string (ly-gulp-file "generate-documentation.scm")) +#(eval-string (ly-gulp-file "generate-engraver-documentation.scm")) +#(eval-string (ly-gulp-file "generate-backend-documentation.scm"))