+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
=======
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;
+}
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 */
#ifndef TEXT_ITEM
#define TEXT_ITEM
+
+#include "lily-proto.hh"
#include "lily-guile.hh"
#include "molecule.hh"
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 */
#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
{
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];
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_)
{
always do the correct thing?
*/
+ bool forget = to_boolean (get_property ("forgetAccidentals"));
if (!forget && !tie_changes)
{
/*
{
Score_element *me = unsmob_element (smob);
Spanner * sp = dynamic_cast<Spanner*> (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;
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);
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);
{
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
}
-
end_volta_span_p_ = volta_span_p_;
volta_span_p_ = 0;
}
-#(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"))