+1.3.96.jcn7
+===========
+
+* Junked all old style text lookups, except for feta definitions.
+
+1.3.96.jcn6
+===========
+
+* Added support for name-based character lookups.
+
1.3.96.jcn5
===========
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=96
-MY_PATCH_LEVEL=jcn6
+MY_PATCH_LEVEL=jcn7
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
\score{
\notes\relative c''{
+ \stemUp
a-"text"
b-\textscript #"texta"
c-\textscript #'(bold "textb")
- d-\textscript #'(lines "een" "twee" "drie")
- e-\textscript #'(lines (bold "een")
- (rows "en" "dat" "is" ((family . "number") "2"))
- (italic "drie"))
+
+ d-\textscript #'(lines "one" "two" "three")
+ e-\textscript #'(lines (bold "one")
+ (rows "and" "there" "is" ((family . "number") "2"))
+ (italic "three"))
f-\textscript #'(finger "3")
g-\textscript #'(music (named "noteheads-2"))
}
linewidth = -1.\mm;
\translator{
\ScoreContext
- TextScript \push #'style-sheet = #'paper16
TextScript \push #'font-family = #'roman
TextScript \pop #'no-spacing-rods
TextScript \push #'direction = #1
#include "paper-column.hh"
#include "line-of-score.hh"
#include "staff-symbol-referencer.hh"
-
-/*
- TODO: move text lookup out of Chord_name
- */
-
-/*
- word is roman text or property-styled text:
- "text"
- ("text" . property-alist)
- */
-Molecule
-Chord_name::ly_word2molecule (Score_element * me, SCM word, Real* x)
-{
- *x = 0;
-
- SCM options_alist = SCM_EOL;
- if (gh_pair_p (word))
- {
- options_alist = gh_cdr (word);
- word = gh_car (word);
- }
-
- if (gh_string_p (word))
- {
- /*
- UGH. Should read from font metric structure.
- */
- Real ex = me->lookup_l ()->text ("", "x",
- me->paper_l ()).extent (Y_AXIS).length ();
- Real em = me->lookup_l ()->text ("", "m",
- me->paper_l ()).extent (X_AXIS).length ();
-
- String w = ly_scm2string (word);
-
- String style;
- SCM s = scm_assoc (ly_symbol2scm ("style"), options_alist);
- if (s != SCM_BOOL_F)
- {
- style = ly_scm2string (gh_cdr (s));
- }
-
- Offset offset;
- int size = 0;
- /*
- urg, `type'
- */
- s = scm_assoc (ly_symbol2scm ("type"), options_alist);
- if (s != SCM_BOOL_F && ly_scm2string (gh_cdr (s)) == "super")
- {
- Real super_y = ex / 2;
- offset = Offset (0, super_y);
- if (!size)
- size = -2;
- }
-
- s = scm_assoc (ly_symbol2scm ("size"), options_alist);
- if (s != SCM_BOOL_F)
- {
- size = gh_scm2int (gh_cdr (s));
- }
-
- s = scm_assoc (ly_symbol2scm ("offset"), options_alist);
- if (s != SCM_BOOL_F)
- {
- // hmm
- SCM o = gh_cdr (s);
- if (gh_pair_p (o))
- offset = Offset (0, gh_scm2double (gh_cdr (o))) * ex;
- *x = gh_scm2double (gh_car (o)) * em;
- }
-
- Molecule mol;
- s = scm_assoc (ly_symbol2scm ("font"), options_alist);
- if (s != SCM_BOOL_F && ly_scm2string (gh_cdr (s)) == "feta")
- mol = me->paper_l ()->lookup_l (size)->afm_find (w);
- else
- mol = me->paper_l ()->lookup_l (size)->text (style, w, me->paper_l ());
-
- mol.translate (offset);
- return mol;
- }
- return Molecule ();
-}
-
-/*
- ;; text: list of word
- ;; word: string + optional list of property
- ;; property: align, kern, font (?), size
- */
-Molecule
-Chord_name::ly_text2molecule (Score_element * me, SCM text)
-{
- Molecule mol;
- if (gh_list_p (text))
- {
- while (gh_cdr (text) != SCM_EOL)
- {
- Real x;
- Molecule m = ly_word2molecule (me, gh_car (text), &x);
- if (!m.empty_b ())
- mol.add_at_edge (X_AXIS, RIGHT, m, x);
- text = gh_cdr (text);
- }
- text = gh_car (text);
- }
- Real x;
- Molecule m = ly_word2molecule (me,text, &x);
- if (!m.empty_b ())
- mol.add_at_edge (X_AXIS, RIGHT, m, x);
- return mol;
-}
+#include "text-item.hh"
MAKE_SCHEME_CALLBACK (Chord_name,after_line_breaking,1);
SCM
SCM func = me->get_elt_property (ly_symbol2scm ("chord-name-function"));
SCM text = gh_call3 (func, style, pitches, gh_cons (inversion, bass));
- Molecule mol = ly_text2molecule (me, text);
+ SCM properties = gh_append2 (me->immutable_property_alist_,
+ me->mutable_property_alist_);
+ Molecule mol = Text_item::text2molecule (me, text, properties);
SCM space = me->get_elt_property ("word-space");
if (gh_number_p (space))
*/
class Dynamic_engraver : public Engraver
{
- Item * text_p_;
+ Item * script_p_;
Spanner * finished_cresc_p_;
Spanner * cresc_p_;
- Text_script_req* text_req_l_;
+ Dynamic_script_req* script_req_l_;
Span_req * current_cresc_req_;
Drul_array<Span_req*> accepted_spanreqs_drul_;
Dynamic_engraver::Dynamic_engraver ()
{
- text_p_ = 0;
+ script_p_ = 0;
finished_cresc_p_ = 0;
line_spanner_ = 0;
finished_line_spanner_ = 0;
current_cresc_req_ = 0;
cresc_p_ =0;
- text_req_l_ = 0;
+ script_req_l_ = 0;
accepted_spanreqs_drul_[START] = 0;
accepted_spanreqs_drul_[STOP] = 0;
}
void
Dynamic_engraver::do_post_move_processing ()
{
- text_req_l_ = 0;
+ script_req_l_ = 0;
accepted_spanreqs_drul_[START] = 0;
accepted_spanreqs_drul_[STOP] = 0;
}
bool
Dynamic_engraver::do_try_music (Music * m)
{
- if (Text_script_req* d = dynamic_cast <Text_script_req*> (m))
+ if (Dynamic_script_req* d = dynamic_cast <Dynamic_script_req*> (m))
{
- if (d->style_str_ == "dynamic")
- {
- text_req_l_ = d;
- return true;
- }
+ script_req_l_ = d;
+ return true;
}
else if (Span_req* s = dynamic_cast <Span_req*> (m))
{
void
Dynamic_engraver::do_process_music ()
{
- if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || text_req_l_)
+ if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || script_req_l_)
{
if (!line_spanner_)
Axis_group_interface::set_axes (line_spanner_, Y_AXIS, Y_AXIS);
Request * rq = accepted_spanreqs_drul_[START];
- if (text_req_l_) rq = text_req_l_ ;
+ if (script_req_l_) rq = script_req_l_ ;
announce_element (line_spanner_, rq);
*/
else if (accepted_spanreqs_drul_[STOP]
- && !accepted_spanreqs_drul_[START] && !text_req_l_)
+ && !accepted_spanreqs_drul_[START] && !script_req_l_)
{
finished_line_spanner_ = line_spanner_;
line_spanner_ = 0;
maybe we should leave dynamic texts to the text-engraver and
simply acknowledge them?
*/
- if (text_req_l_)
+ if (script_req_l_)
{
- String loud = text_req_l_->text_str_;
-
- text_p_ = new Item (get_property ("DynamicText"));
- text_p_->set_elt_property ("text", ly_str02scm (loud.ch_C ()));
- if (Direction d=text_req_l_->get_direction ())
+ script_p_ = new Item (get_property ("DynamicText"));
+ script_p_->set_elt_property ("text", script_req_l_->text_);
+ if (Direction d = script_req_l_->get_direction ())
Directional_element_interface::set (line_spanner_, d);
- Axis_group_interface::add_element (line_spanner_, text_p_);
+ Axis_group_interface::add_element (line_spanner_, script_p_);
- announce_element (text_p_, text_req_l_);
+ announce_element (script_p_, script_req_l_);
}
if (accepted_spanreqs_drul_[STOP])
Score_element *cc = unsmob_element (get_property ("currentMusicalColumn"));
cresc_p_->set_bound (LEFT, cc);
- if (text_p_)
+ if (script_p_)
{
- Side_position::set_direction (text_p_, LEFT);
- Side_position::set_axis (text_p_, X_AXIS);
- Side_position::add_support (text_p_, cresc_p_);
+ Side_position::set_direction (script_p_, LEFT);
+ Side_position::set_axis (script_p_, X_AXIS);
+ Side_position::add_support (script_p_, cresc_p_);
}
Axis_group_interface::add_element (line_spanner_, cresc_p_);
finished_cresc_p_ =0;
}
- if (text_p_)
+ if (script_p_)
{
- typeset_element (text_p_);
- text_p_ = 0;
+ typeset_element (script_p_);
+ script_p_ = 0;
}
if (finished_line_spanner_)
{
virtual void do_pre_move_processing ();
private:
- Text_script_req* text_script_req_l_;
+ Dynamic_script_req* script_req_l_;
Audio_dynamic* audio_p_;
};
Dynamic_performer::Dynamic_performer ()
{
- text_script_req_l_ = 0;
+ script_req_l_ = 0;
audio_p_ = 0;
}
void
Dynamic_performer::do_process_music ()
{
- if (text_script_req_l_)
+ if (script_req_l_)
{
SCM proc = get_property ("dynamicAbsoluteVolumeFunction");
SCM svolume = SCM_EOL;
if (gh_procedure_p (proc))
{
- svolume = gh_call1 (proc, ly_str02scm (text_script_req_l_->text_str_.ch_C ()));
+ // urg
+ svolume = gh_call1 (proc, script_req_l_->text_);
}
Real volume = 0.5;
}
audio_p_ = new Audio_dynamic (volume);
- Audio_element_info info (audio_p_, text_script_req_l_);
+ Audio_element_info info (audio_p_, script_req_l_);
announce_element (info);
- text_script_req_l_ = 0;
+ script_req_l_ = 0;
}
}
bool
Dynamic_performer::do_try_music (Music* r)
{
- if (!text_script_req_l_)
+ if (!script_req_l_)
{
- // urg, text script, style `dynamic' is how absolute dynamics appear
- if(Text_script_req* t = dynamic_cast <Text_script_req*> (r))
+ if(Dynamic_script_req* d = dynamic_cast <Dynamic_script_req*> (r))
{
- if (t->style_str_ == "dynamic")
- {
- text_script_req_l_ = t;
- return true;
- }
+ script_req_l_ = d;
+ return true;
}
}
return false;
{
public:
DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM ));
- static Molecule ly_word2molecule (Score_element*, SCM scm, Real* x) ;
- static Molecule ly_text2molecule (Score_element*, SCM scm) ;
DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM ));
};
static Molecule dashed_slur (Bezier, Real thick, Real dash) ;
static Molecule blank (Box b) ;
static Molecule filledbox (Box b) ;
- static Molecule text (String style, String text, Paper_def*) ;
};
Lookup* unsmob_lookup (SCM);
#endif // LOOKUP_HH
#include "duration.hh"
#include "musical-pitch.hh"
#include "array.hh"
+#include "protected-scm.hh"
/** a request with a duration.
};
-/** a syllable or lyric is a string with rhythm.
+/**
+ a syllable or lyric is a string with rhythm.
*/
-class Lyric_req : public Rhythmic_req {
+class Lyric_req : public Rhythmic_req
+{
public:
+ Protected_scm text_;
- String text_str_;
- VIRTUAL_COPY_CONS(Music);
+protected:
+ VIRTUAL_COPY_CONS (Music);
};
class Text_script_req : public Script_req
{
public:
- String text_str_; // to be deprecated
- String style_str_; // to be deprecated
-
- SCM text_scm_;
+ Protected_scm text_;
protected:
- VIRTUAL_COPY_CONS(Music);
- virtual bool do_equal_b (Request const*)const;
+ VIRTUAL_COPY_CONS (Music);
+ virtual bool do_equal_b (Request const*) const;
};
+class Dynamic_script_req : public Script_req
+{
+public:
+ Protected_scm text_;
+
+protected:
+ VIRTUAL_COPY_CONS (Music);
+};
/// request which has some kind of pitch
struct Melodic_req :virtual Request
}
-/*
- JUNKME
-
- TODO: THIS IS UGLY.
- Since the user has direct access to TeX marcos,
- that currently provide the only way to do
- font selection, accents etc,
- we try some halfbaked attempt to detect this TeX trickery.
- */
-String
-sanitise_TeX_string (String text)
-{
- int brace_count =0;
- for (int i= 0; i < text.length_i (); i++)
- {
- if (text[i] == '\\')
- continue;
-
- if (text[i] == '{')
- brace_count ++;
- else if (text[i] == '}')
- brace_count --;
- }
-
- if(brace_count)
- {
- warning (_f ("Non-matching braces in text `%s', adding braces", text.ch_C()));
-
- if (brace_count < 0)
- {
- text = to_str ('{', -brace_count) + text;
- }
- else
- {
- text = text + to_str ('}', brace_count);
- }
- }
-
- return text;
-}
-
-/**
- JUNKME
-*/
-Molecule
-Lookup::text (String style, String text, Paper_def *paper_l)
-{
- if (style.empty_b ())
- style = "roman";
-
- int font_mag = 0;
- Real font_h = paper_l->get_var ("font_normal");
- if (paper_l->scope_p_->elem_b ("font_" + style))
- {
- font_h = paper_l->get_var ("font_" + style);
- }
-
-
- if (paper_l->scope_p_->elem_b ("magnification_" + style))
- {
- font_mag = (int)paper_l->get_var ("magnification_" + style);
- }
-
- /*
- FIXME !
- */
-
- SCM l = scm_assoc (ly_str02scm (style.ch_C()),
- scm_eval2 (ly_symbol2scm ("cmr-alist"), SCM_EOL));
-
- if (l != SCM_BOOL_F)
- {
- style = ly_scm2string (gh_cdr(l)) +to_str ((int)font_h);
- }
-
- Font_metric* metric_l = 0;
-
- if (font_mag)
- metric_l = all_fonts_global_p->find_scaled (style, font_mag);
- else
- metric_l = all_fonts_global_p->find_font (style);
-
-
-
-
- int i = text.index_i ("\\n");
- while (i >=0 )
- {
- text = text.left_str (i) + "\n" + text.right_str (text.length_i () - i - 2);
- i = text.index_i ("\\n");
- }
-
- Array<String> lines = String_convert::split_arr (text, '\n');
-
- Real kern = paper_l->get_var ("line_kern");
-
- for (int i=0; i < lines.size (); i++)
- {
- String str (lines[i]);
- if (output_global_ch == "tex")
- str = sanitise_TeX_string (str);
- lines[i] = str;
- }
-
- if (!lines.size())
- return Molecule();
-
- SCM first = gh_list (ly_symbol2scm ("text"),
- ly_str02scm (lines[0].ch_C()),
- SCM_UNDEFINED);
- first = fontify_atom (metric_l, first);
-
-
-
- Molecule mol (metric_l->text_dimension (lines[0]), first);
-
- for (i = 1; i < lines.size (); i++)
- {
- SCM line = (gh_list (ly_symbol2scm ("text"),
- ly_str02scm (lines[i].ch_C ()),
- SCM_UNDEFINED));
- line = fontify_atom (metric_l, line);
- mol.add_at_edge (Y_AXIS, DOWN,
- Molecule (metric_l->text_dimension (lines[i]), line),
- kern);
- }
-
- return mol;
-}
-
-
-
/*
Make a smooth curve along the points
*/
{
text_p_= new Item (get_property ("LyricText"));
- text_p_->set_elt_property ("text",
-// ly_str02scm ((req_l_->text_str_ + " ").ch_C ()));
- ly_str02scm ((req_l_->text_str_).ch_C ()));
-
+ text_p_->set_elt_property ("text", req_l_->text_);
/*
We can't reach the notehead where we're centered from here. So
void
Lyric_performer::do_process_music ()
{
- if (lreq_arr_.size () && lreq_arr_[0]->text_str_.length_i ())
+ // FIXME: won't work with fancy lyrics
+ if (lreq_arr_.size () && gh_string_p (lreq_arr_[0]->text_)
+ && ly_scm2string (lreq_arr_[0]->text_).length_i ())
{
- audio_p_ = new Audio_text (Audio_text::LYRIC, lreq_arr_[0]->text_str_);
+ audio_p_ = new Audio_text (Audio_text::LYRIC,
+ ly_scm2string (lreq_arr_[0]->text_));
Audio_element_info info (audio_p_, lreq_arr_[0]);
announce_element (info);
}
else if (Audio_time_signature* i = dynamic_cast<Audio_time_signature*> (a))
return new Midi_time_signature (i);
else if (Audio_text* i = dynamic_cast<Audio_text*> (a))
- return i->text_str_.length_i () ? new Midi_text (i) : 0;
+ //return i->text_str_.length_i () ? new Midi_text (i) : 0;
+ return new Midi_text (i);
else
assert (0);
audio_l_ = a;
}
-#if 0
-Midi_text::Midi_text (Midi_text::Type type, String text_str)
- : Audio_text ()
-{
- text_str_ = text_str;
- type_ = type;
-}
-#endif
-
String
Midi_text::str () const
{
#include "group-interface.hh"
#include "spanner.hh"
#include "staff-symbol-referencer.hh"
+#include "text-item.hh"
void
Multi_measure_rest::set_interface (Score_element*me)
if (measures > 1)
{
- Molecule s (me->lookup_l ()->text ("number", to_str (measures), me->paper_l ()));
+ SCM properties = gh_append2 (me->immutable_property_alist_,
+ me->mutable_property_alist_);
+ Molecule s =
+ Text_item::text2molecule (me,
+ ly_str02scm (to_str (measures).ch_C ()),
+ properties);
s.align_to (X_AXIS, CENTER);
s.translate_axis (3.0 * staff_space, Y_AXIS);
mol.add_molecule (s);
Text_script_req::do_equal_b (Request const* r) const
{
Text_script_req const* t = dynamic_cast<Text_script_req const*> (r);
- return t && t->text_str_ == text_str_ && t->style_str_ == style_str_;
+ return t && gh_equal_p (text_, t->text_);
}
{"context", CONTEXT},
{"denies", DENIES},
{"duration", DURATION},
+ {"dynamicscript", DYNAMICSCRIPT},
{"font", FONT},
{"grace", GRACE},
{"header", HEADER},
/* tokens which are not keywords */
%token AUTOCHANGE
%token ARPEGGIO
+%token DYNAMICSCRIPT
%token TEXTSCRIPT
%token ACCEPTS
%token ALTERNATIVE
$$ = dynamic_cast<Request*> (unsmob_music ($1)->clone ());
$$->set_spot (THIS->here_input ());
}
- | TEXTSCRIPT STRING STRING {
- Text_script_req *ts_p = new Text_script_req;
- ts_p-> text_str_ = ly_scm2string ($2);
- ts_p-> style_str_ = ly_scm2string ($3);
- ts_p->set_spot (THIS->here_input ());
-
- $$ = ts_p;
+ | DYNAMICSCRIPT embedded_scm {
+ Dynamic_script_req *d = new Dynamic_script_req;
+ d->text_ = $2;
+ d->set_spot (THIS->here_input ());
+ $$ = d;
}
| TEXTSCRIPT embedded_scm {
- Text_script_req *ts_p = new Text_script_req;
- ts_p->text_scm_ = $2;
- ts_p->set_spot (THIS->here_input ());
- $$ = ts_p;
+ Text_script_req *t = new Text_script_req;
+ t->text_ = $2;
+ t->set_spot (THIS->here_input ());
+ $$ = t;
}
| SPANREQUEST bare_int STRING {
Span_req * sp_p = new Span_req;
;
gen_text_def:
- string {
- Text_script_req *t = new Text_script_req;
+ embedded_scm {
+ Text_script_req *t = new Text_script_req;
+ t->text_ = $1;
+ t->set_spot (THIS->here_input ());
+ $$ = t;
+ }
+ | string {
+ Text_script_req *t = new Text_script_req;
+ t->text_ = $1;
+ t->set_spot (THIS->here_input ());
$$ = t;
- t->text_str_ = ly_scm2string ($1);
-
- $$->set_spot (THIS->here_input ());
}
| DIGIT {
- Text_script_req* t = new Text_script_req;
+ /*
+ Maybe use Finger_script_request?
+ */
+ Text_script_req* t = new Text_script_req;
+ t->text_ = gh_cons (ly_symbol2scm ("finger"),
+ ly_str02scm (to_str ($1).ch_C ()));
+ t->set_spot (THIS->here_input ());
$$ = t;
- t->text_str_ = to_str ($1);
- t->style_str_ = "finger";
- $$->set_spot (THIS->here_input ());
}
;
else
THIS->pop_spot ();
Lyric_req* lreq_p = new Lyric_req;
- lreq_p ->text_str_ = ly_scm2string ($1);
+ lreq_p ->text_ = $1;
lreq_p->duration_ = *$3;
lreq_p->set_spot (THIS->here_input());
Simultaneous_music* velt_p = new Request_chord (gh_list (lreq_p->self_scm (), SCM_UNDEFINED));
{
if (Text_script_req *r = dynamic_cast<Text_script_req*> (m))
{
- if (r->style_str_ == "dynamic")
- return false;
-
reqs_.push (r);
return true;
}
for (int i=0; i < reqs_.size (); i++)
{
Text_script_req * r = reqs_[i];
+
+ // URG: Text vs TextScript
+ String basic = "TextScript";
- String basic = "TextScript";
-
+#if 0
+ // maybe use some sort of TYPE for script/dynamic/finger?
+
// separate engraver?
if (r->style_str_== "finger")
{
basic = "Fingering";
}
- Item *text = new Item (get_property (basic.ch_C()));
+#endif
+ Item *text = new Item (get_property (basic.ch_C ()));
/*
FIXME -> need to use basic props.
Axis ax = to_boolean (axisprop) ? X_AXIS : Y_AXIS;
Side_position::set_axis (text, ax);
+#if 0
if (r->style_str_ == "finger" && ax == Y_AXIS)
{
/*
text->add_offset_callback (Side_position::aligned_on_self_proc, X_AXIS);
text->add_offset_callback (Side_position::centered_on_parent_proc, X_AXIS);
}
+#endif
if (r->get_direction ())
Side_position::set_direction (text, r->get_direction ());
- if (r->text_str_.length_i ())
- text->set_elt_property ("text",
- ly_str02scm ( r->text_str_.ch_C ()));
- else
- {
- text->set_elt_property ("text", r->text_scm_);
- text->set_elt_property ("scm-text", r->text_scm_);
- }
+ text->set_elt_property ("text", r->text_);
- if (r->style_str_.length_i ())
- text->set_elt_property ("style", ly_str02scm (r->style_str_.ch_C()));
-
SCM nonempty = get_property ("textNonEmpty");
if (to_boolean (nonempty))
/*
return Molecule ();
}
+static
+SCM
+get_elt_property (Score_element *me, char const *name)
+{
+ SCM s = me->get_elt_property (name);
+ if (s == SCM_EOL)
+ error (_f ("No `%s' defined for %s", name, me->name ()));
+ return s;
+}
+
Molecule
Text_item::string2molecule (Score_element *me, SCM text, SCM properties)
{
SCM style = scm_assoc (ly_symbol2scm ("font-style"), properties);
SCM paper = me->get_elt_property ("style-sheet");
+ if (paper == SCM_EOL)
+ paper = scm_string_to_symbol (me->paper_l ()->get_scmvar ("style_sheet"));
+
SCM font_name;
if (gh_pair_p (style))
{
- SCM f = me->get_elt_property ("style-to-font-name");
+ SCM f = get_elt_property (me, "style-to-font-name");
font_name = gh_call2 (f, paper, gh_cdr (style));
}
else
{
- SCM f = me->get_elt_property ("properties-to-font-name");
+ SCM f = get_elt_property (me, "properties-to-font-name");
font_name = gh_call2 (f, paper, properties);
}
{
SCM markup = gh_car (markup_sentence);
SCM sentence = gh_cdr (markup_sentence);
- SCM f = me->get_elt_property ("markup-to-properties");
-
+ SCM f = get_elt_property (me, "markup-to-properties");
SCM p = gh_cons (gh_call1 (f, markup), properties);
Axis align = X_AXIS;
MAKE_SCHEME_CALLBACK (Text_item, brew_molecule, 1);
SCM
-Text_item::brew_molecule (SCM smob)
+Text_item::brew_molecule (SCM smob)
{
Score_element *me = unsmob_element (smob);
- SCM text = me->get_elt_property ("scm-text");
- Molecule mol;
- if (text == SCM_EOL)
- {
- SCM style = me->get_elt_property ("style");
- String st = gh_string_p (style) ? ly_scm2string (style) : "";
- SCM text = me->get_elt_property ("text");
- String t = gh_string_p (text) ? ly_scm2string (text) : "";
-
- mol = me->paper_l ()->lookup_l (0)->text (st, t, me->paper_l ());
- }
- else
- mol = text2molecule (me, text,
- gh_append2 (me->immutable_property_alist_,
- me->mutable_property_alist_));
+ SCM text = me->get_elt_property ("text");
+
+ SCM properties = gh_append2 (me->immutable_property_alist_,
+ me->mutable_property_alist_);
+
+ Molecule mol = Text_item::text2molecule (me, text, properties);
SCM space = me->get_elt_property ("word-space");
if (gh_number_p (space))
*/
#include "molecule.hh"
+#include "text-item.hh"
#include "text-spanner.hh"
#include "spanner.hh"
#include "lookup.hh"
}
while (flip (&d) != LEFT);
+#if 0
SCM s = me->get_elt_property ("text-style");
+
String text_style = "italic";
if (gh_string_p (s))
text_style = ly_scm2string (s);
-
+#endif
+
+ SCM properties = gh_append2 (me->immutable_property_alist_,
+ me->mutable_property_alist_);
SCM edge_text = me->get_elt_property ("edge-text");
Drul_array<Molecule> edge;
if (gh_pair_p (edge_text))
Direction d = LEFT;
do
{
- String text = ly_scm2string (index_cell (edge_text, d));
- edge[d] = me->lookup_l ()->text (text_style, text, me->paper_l ());
+ SCM text = index_cell (edge_text, d);
+ edge[d] = Text_item::text2molecule (me, text, properties);
if (!edge[d].empty_b ())
edge[d].align_to (Y_AXIS, CENTER);
}
shorten[LEFT] = 0;
shorten[RIGHT] = 0;
- s = me->get_elt_property ("shorten");
+ SCM s = me->get_elt_property ("shorten");
if (gh_pair_p (s))
{
shorten[LEFT] = gh_scm2double (gh_car (s)) * staff_space;
#include "molecule.hh"
+#include "text-item.hh"
#include "time-signature.hh"
#include "paper-def.hh"
#include "lookup.hh"
Molecule
Time_signature::time_signature (Score_element*me,int num, int den)
{
- String sty = "timesig";
-
/*
UGH: need to look at fontsize.
+ TODO: specify using scm markup.
*/
- Molecule n (me->lookup_l ()->text (sty, to_str (num), me->paper_l ()));
- Molecule d (me->lookup_l ()->text (sty, to_str (den), me->paper_l ()));
+ SCM properties = gh_append2 (me->immutable_property_alist_,
+ me->mutable_property_alist_);
+ Molecule n = Text_item::text2molecule (me,
+ ly_str02scm (to_str (num).ch_C ()),
+ properties);
+ Molecule d = Text_item::text2molecule (me,
+ ly_str02scm (to_str (den).ch_C ()),
+ properties);
n.align_to (X_AXIS, CENTER);
d.align_to (X_AXIS, CENTER);
Molecule m;
#include "molecule.hh"
#include "paper-column.hh"
#include "paper-def.hh"
+#include "text-item.hh"
#include "tuplet-spanner.hh"
#include "stem.hh"
#include "note-column.hh"
SCM number = me->get_elt_property ("text");
if (gh_string_p (number) && number_visibility)
{
- Molecule
- num (me->lookup_l ()->text ("italic",
- ly_scm2string (number), me->paper_l ()));
+ SCM properties = gh_append2 (me->immutable_property_alist_,
+ me->mutable_property_alist_);
+ Molecule num = Text_item::text2molecule (me, number, properties);
num.align_to (X_AXIS, CENTER);
num.translate_axis (w/2, X_AXIS);
num.align_to (Y_AXIS, CENTER);
#include "molecule.hh"
#include "paper-column.hh"
#include "paper-def.hh"
+#include "text-item.hh"
#include "volta-spanner.hh"
#include "group-interface.hh"
#include "side-position-interface.hh"
SCM_UNDEFINED));
Box b (Interval (0, w), Interval (0, h));
- Molecule mol (b, at);
- Molecule num (me->lookup_l ()->text ("volta",
- ly_scm2string (me->get_elt_property("text")),
- me->paper_l ()));
+ Molecule mol (b, at);
+ SCM text = me->get_elt_property("text");
+ SCM properties = gh_append2 (me->immutable_property_alist_,
+ me->mutable_property_alist_);
+ Molecule num = Text_item::text2molecule (me, text, properties);
mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
- staff_space);
% ugh
\include "midi.ly"
-\include "textscripts.ly"
+\include "dynamic-scripts.ly"
\include "spanners.ly"
\include "property.ly"
% ugh
\include "midi.ly"
-\include "textscripts.ly"
+\include "dynamic-scripts.ly"
\include "spanners.ly"
\include "property.ly"
--- /dev/null
+
+%
+% declare the standard dynamic identifiers.
+%
+
+ppp = \dynamicscript #"ppp"
+pp = \dynamicscript #"pp"
+p = \dynamicscript #"p"
+mp = \dynamicscript #"mp"
+mf = \dynamicscript #"mf"
+f = \dynamicscript #"e" % see feta-din layout
+ff = \dynamicscript #"ff"
+fff = \dynamicscript #"fff"
+fp = \dynamicscript #"fp"
+
+sf = \dynamicscript #"sf"
+sfp = \dynamicscript #"sfp"
+sff = \dynamicscript #"sff"
+sfz = \dynamicscript #"sfz"
+fz = \dynamicscript #"fz"
+sp = \dynamicscript #"sp"
+spp = \dynamicscript #"spp"
+rfz = \dynamicscript #"rfz"
+
(molecule-callback . ,Text_item::brew_molecule)
(breakable . #t)
(visibility-lambda . ,begin-of-line-visible)
- (name . "BarNumber")
(padding . 1.0)
(direction . 1)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-family . roman)
+ (name . "BarNumber")
)
Beam = #basic-beam-properties
)
DynamicText = #`(
- (style . "dynamic")
(interfaces . (dynamic-interface))
(Y-offset-callbacks . (,Side_position::aligned_on_self))
-
(molecule-callback . ,Text_item::brew_molecule)
+ (font-style . dynamic)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
(script-priority . 100)
(self-alignment-Y . 0)
(name . "DynamicText")
(molecule-callback . ,Text_item::brew_molecule)
(break-align-symbol . Instrument_name)
(visibility-lambda . ,begin-of-line-visible)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-family . roman)
(name . "InstrumentName")
)
(self-alignment-X . 0)
(non-rhythmic . #t)
(word-space . 0.6)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-family . roman)
(name . "LyricText")
)
RehearsalMark = #`(
- (interfaces . (mark-interface side-position-interface))
- (molecule-callback . ,Text_item::brew_molecule)
- (breakable . #t)
- (visibility-lambda . ,end-of-line-invisible)
- (padding . 4.0)
- (name . "RehearsalMark")
+ (interfaces . (mark-interface side-position-interface))
+ (molecule-callback . ,Text_item::brew_molecule)
+ (breakable . #t)
+ (visibility-lambda . ,end-of-line-invisible)
+ (padding . 4.0)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-style . mark)
+ (name . "RehearsalMark")
)
MultiMeasureRest = #`(
(X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self))
(Y-offset-callbacks . (,Side_position::aligned_side))
(molecule-callback . ,Text_item::brew_molecule)
- (style . "italic")
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
(name . "OctavateEight")
)
(molecule-callback . ,Text_spanner::brew_molecule)
(type . "line")
(direction . 1)
- (text-style . "italic")
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
(name . "TextSpanner")
)
Tie = #`(
(break-align-symbol . Time_signature)
(visibility-lambda . ,all-visible)
(breakable . #t)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-style . timesig)
(name . "TimeSignature")
)
TupletBracket = #`(
+ (interfaces . (tuplet-spanner-interface))
(number-gap . 2.0)
(delta-y . 0)
(thick . 1.0)
(after-line-breaking-callback . ,Tuplet_spanner::after_line_breaking)
(molecule-callback . ,Tuplet_spanner::brew_molecule)
- (interfaces . (tuplet-spanner-interface))
- (name "TupletBracket")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-shape . "italic")
+ (name . "TupletBracket")
)
SostenutoPedal = #`(
(,Side_position::aligned_side
,Side_position::centered_on_parent))
- (style . "italic")
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
(no-spacing-rods . #t)
(self-alignment-X . 0)
(name . "SostenutoPedal")
)
UnaChordaPdeal = #`(
(molecule-callback . ,Text_item::brew_molecule)
- (style . "italic")
+ (font-shape . "italic")
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
(no-spacing-rods . #t)
(self-alignment-X . 0)
(X-offset-callbacks . (,Side_position::aligned_on_self))
(thickness . 1.6) ; stafflinethickness
(height . 2.0) ; staffspace;
(minimum-space . 25)
+ (properties-to-font-name . ,properties-to-font-name)
+ (style-to-font-name . ,style-to-font-name)
+ (markup-to-properties . ,markup-to-properties)
+ (font-style . volta)
(name . "VoltaBracket")
)
paper_eleven = \paper {
staffheight = 11.0\pt;
-
-
- font_Large = 8.;
- font_large = 6.;
- font_normal = 5.;
- font_script = 4.;
-
- font_finger = 4.;
- font_volta = 4.;
- font_number = 4.;
- font_dynamic = 10.;
- font_mark = 6.;
-
- % UGH!
- magnification_dynamic = -4.0;
+ style_sheet = "paper11";
-1=\font "feta11"
-2=\font "feta11"
0=\font "feta11"
- "font_feta-2" = 11.;
- "font_feta-1" = 11.;
- "font_feta" = 11.;
-
\include "params.ly";
}
paper_thirteen = \paper {
staffheight = 13.0\pt;
-
-
- font_Large = 8.;
- font_large = 6.;
- font_normal = 5.;
- font_script = 4.;
-
- font_finger = 4.;
- font_volta = 4.;
- font_number = 6.;
- font_dynamic = 10.;
- font_mark = 6.;
+ style_sheet = "paper13";
0=\font "feta13"
-1=\font "feta11"
- "font_feta-2" = 11.;
- "font_feta-1" = 11.;
- "font_feta" = 13.;
-
\include "params.ly";
}
paper_sixteen = \paper {
staffheight = 16.0\pt;
- font_Large = 12.;
- font_large = 10.;
- font_normal = 8.;
- font_script = 7.;
-
- magnification_dynamic = 1.0;
- font_finger = 4.;
- font_volta = 5.;
- font_number = 8.;
- font_timesig = 8.;
- font_dynamic = 10.;
- font_mark = 10.;
- font_msam = 8.;
+ style_sheet = "paper20";
0 = \font "feta16"
-1 = \font "feta13"
-2 = \font "feta11"
-3 = \font "feta11"
-
- "font_feta" = 16.;
- "font_feta-1" = 13.;
- "font_feta-2" = 11.;
- "font_feta-3" = 11.;
\include "params.ly";
}
paper_twenty = \paper {
staffheight = 20.0\pt;
+ style_sheet = "paper20";
- font_Large = 12.;
- font_large = 12.;
- font_normal = 10.;
- font_script = 8.;
-
- font_finger = 5.;
- font_volta = 8.;
- font_number = 10.;
- font_timesig = 10.;
- font_mark = 12.;
- font_msam = 9.;
-
- % what about:
- "font_number-1" = 8.;
- %"font_number" = 10.;
- "font_number+1" = 12.;
-
- % Ugh
- magnification_dynamic = 2.;
-
0 = \font "feta20"
-1 = \font "feta16"
-2 = \font "feta13"
-3 = \font "feta11"
- "font_feta" = 20.;
- "font_feta-1" = 16.;
- "font_feta-2" = 13.;
- "font_feta-3" = 11.;
-
\include "params.ly";
}
paper_twentythree = \paper {
staffheight = 23.0\pt;
-
- font_Large = 12.;
- font_large = 12.;
- font_normal = 10.;
- font_script = 8.;
-
- font_finger = 5.;
- font_volta = 8.;
- font_number = 10.;
- font_mark = 12.;
-
- % Ugh
- magnification_dynamic = 3.;
+ style_sheet = "paper23";
-2 = \font "feta16"
-1 = \font "feta20"
0 = \font "feta23"
- "font_feta-2" = 16.;
- "font_feta-1" = 20.;
- "font_feta" = 23.;
-
\include "params.ly";
}
paper_twentysix = \paper {
staffheight = 26.0\pt;
- font_Large = 17.;
- font_large = 14.;
- font_normal = 12.;
- font_script = 10.;
-
- font_dynamic = 10.;
- % Ugh
- magnification_dynamic = 4.;
-
- font_finger = 8.;
- font_volta = 10.;
- font_number = 10.;
- magnification_number = 2.;
- font_mark = 14.;
+ style_sheet = "paper26";
0=\font "feta26"
-1 = \font "feta23"
-2 = \font "feta20"
- "font_feta-2" = 20.;
- "font_feta-1" = 23.;
- "font_feta" = 26.;
-
\include "params.ly";
}
-
-%
-% declare the standard dynamic identifiers.
-%
-
-ppp = \textscript "ppp" "dynamic"
-pp = \textscript "pp" "dynamic"
-p = \textscript "p" "dynamic"
-mp = \textscript "mp" "dynamic"
-mf = \textscript "mf" "dynamic"
-f = \textscript "e" "dynamic" % see feta-din layout
-ff = \textscript "ff" "dynamic"
-fff = \textscript "fff" "dynamic"
-fp = \textscript "fp" "dynamic"
-
-sf = \textscript "sf" "dynamic"
-sfp = \textscript "sfp" "dynamic"
-sff = \textscript "sff" "dynamic"
-sfz = \textscript "sfz" "dynamic"
-fz = \textscript "fz" "dynamic"
-sp = \textscript "sp" "dynamic"
-spp = \textscript "spp" "dynamic"
-rfz = \textscript "rfz" "dynamic"
-