start to note-column.
* lily/hairpin.cc (print): check text-interface, to attach to
dynamic texts.
* lily/include/text-item.hh (class Text_interface): rename
Text_item -> Text_interface
* lily/piano-pedal-bracket.cc (print): robustify.
SCM chain = Font_interface::text_font_alist_chain (me);
chain = scm_cons (me->get_property ("balloon-text-props"), chain);
- SCM text = Text_item::interpret_markup (me->get_paper ()->self_scm (),
+ SCM text = Text_interface::interpret_markup (me->get_paper ()->self_scm (),
chain, bt);
Stencil *text_stil = unsmob_stencil (text);
Direction stem_dir = stems.size() ? to_dir (stems[0]->get_property ("direction")) : UP;
- Stencil tm = *unsmob_stencil (Text_item::interpret_markup
+ Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
(me->get_paper ()->self_scm (), properties, quant_score));
the_beam.add_at_edge (Y_AXIS, stem_dir, tm, 1.0, 0);
}
Note: line-spanner must always have at least same duration
as (de)crecsendo, b.o. line-breaking.
*/
-
/*
}
}
- cresc_->set_bound (LEFT, script_
- ? script_
- : unsmob_grob (get_property ("currentMusicalColumn")));
-
+ if (script_)
+ {
+ cresc_->set_bound (LEFT, script_);
+ add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
+ }
+
Axis_group_interface::add_element (line_spanner_, cresc_);
-
- add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
}
}
}
typeset_all ();
if (!current_cresc_ev_)
{
-
finished_line_spanner_ = line_spanner_;
line_spanner_ = 0;
typeset_all ();
}
+ if (cresc_ && !cresc_->get_bound (LEFT))
+ {
+ cresc_->set_bound (LEFT, unsmob_grob (get_property ("currentMusicalColumn")));
+ add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
+ }
+
script_ev_ = 0;
accepted_spanreqs_drul_[START] = 0;
accepted_spanreqs_drul_[STOP] = 0;
if (ly_c_pair_p (head))
script_->set_parent (unsmob_grob (ly_car (head)), X_AXIS);
}
+
+
+
+ if (cresc_ && !cresc_->get_bound (LEFT))
+ {
+ cresc_->set_bound (LEFT, info.grob_);
+ add_bound_item (line_spanner_, cresc_->get_bound (LEFT));
+ }
+
}
else if (Script_interface::has_interface (info.grob_) && script_)
{
SCM text = index_get_cell (edge_text, d);
- if (Text_item::markup_p (text))
- edge[d] = *unsmob_stencil (Text_item::interpret_markup (paper->self_scm (), properties, text));
+ if (Text_interface::markup_p (text))
+ edge[d] = *unsmob_stencil (Text_interface::interpret_markup (paper->self_scm (), properties, text));
if (!edge[d].is_empty ())
edge[d].align_to (Y_AXIS, CENTER);
#include "warn.hh"
#include "paper-column.hh"
#include "lookup.hh"
+#include "text-item.hh"
MAKE_SCHEME_CALLBACK (Hairpin, print, 1);
}
else
{
- if (dynamic_cast<Paper_column*> (b))
+ if (Text_interface::has_interface (b))
+ {
+ Interval e = b->extent (common, X_AXIS);
+ if (!e.is_empty ())
+ x_points[d] = e[-d] - d*padding;
+ }
+ else
{
bool neighbor_found = false;
for (SCM adj = me->get_property ("adjacent-hairpins");
ly_c_pair_p (adj); adj = ly_cdr (adj))
{
/*
- FIXME: this will fuck up in case of polyphonic
- notes in other voices. Need to look at note-columns
- in the current staff/voice.
+ FIXME: this will fuck up in case of polyphonic
+ notes in other voices. Need to look at note-columns
+ in the current staff/voice.
*/
Spanner *pin = unsmob_spanner (ly_car (adj));
x_points[d] =
neighbor_found ? e.center() - d * padding / 3 : e[d];
}
- else
- {
- Interval e = b->extent (common, X_AXIS);
- if (!e.is_empty ())
- x_points[d] = e[-d] - d*padding;
- }
+
}
}
while (flip (&d) != LEFT);
Hyphen_engraver::acknowledge_grob (Grob_info i)
{
Item * item = dynamic_cast<Item*> (i.grob_);
- // -> text_item
+ // -> Text_item
if (item && item->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
{
if (hyphen_)
#include "lily-guile.hh"
#include "stencil.hh"
-class Text_item
+class Text_interface
{
public:
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (interpret_string, (SCM, SCM, SCM, SCM));
static bool has_interface (Grob*);
static bool markup_p (SCM) ;
-
};
-
-
-
-
#endif /* TEXT_ITEM */
SCM m = mark_ev_->get_property ("label");
SCM proc = get_property ("markFormatter");
- if (!Text_item::markup_p (m) &&
+ if (!Text_interface::markup_p (m) &&
ly_c_procedure_p (proc))
{
if (!scm_is_number (m))
warning ("rehearsalMark does not have integer value.");
}
- if (Text_item::markup_p (m))
+ if (Text_interface::markup_p (m))
text_->set_property ("text", m);
else
warning ("Mark label should be markup object.");
SCM properties = Font_interface::text_font_alist_chain (me);
SCM markup = me->get_property ("text");
Stencil text;
- if (Text_item::markup_p (markup))
- text = *unsmob_stencil (Text_item::interpret_markup (paper->self_scm (), properties, markup));
+ if (Text_interface::markup_p (markup))
+ text = *unsmob_stencil (Text_interface::interpret_markup (paper->self_scm (), properties, markup));
Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pair"),
String r = to_string (Paper_column::get_rank (me));
SCM properties = Font_interface::text_font_alist_chain (me);
- SCM scm_mol = Text_item::interpret_markup (me->get_paper ()->self_scm (),
+ SCM scm_mol = Text_interface::interpret_markup (me->get_paper ()->self_scm (),
properties,
scm_makfrom0str (r.to_str0 ()));
Stencil t = *unsmob_stencil (scm_mol);
*destination = p->self_scm ();
return OUTPUT_DEF_IDENTIFIER;
- } else if (Text_item::markup_p (sid)) {
+ } else if (Text_interface::markup_p (sid)) {
*destination = sid;
return MARKUP_IDENTIFIER;
}
else if (what == ly_symbol2scm ("unisono"))
text = get_property ("aDueText");
- if (Text_item::markup_p (text))
+ if (Text_interface::markup_p (text))
{
text_ = make_item ("CombineTextScript", event_->self_scm () );
text_->set_property ("text", text);
String str;
SCM properties = Font_interface::text_font_alist_chain (me);
- Stencil tm = *unsmob_stencil (Text_item::interpret_markup
+ Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
(me->get_paper ()->self_scm (), properties,
quant_score));
a.add_at_edge (Y_AXIS, get_grob_direction (me), tm, 1.0, 0);
/*
- text-item.cc -- implement Text_item
+ text-item.cc -- implement Text_interface
source file of the GNU LilyPond music typesetter
#include "modified-font-metric.hh"
#include "ly-module.hh"
-MAKE_SCHEME_CALLBACK (Text_item, interpret_string, 4)
+MAKE_SCHEME_CALLBACK (Text_interface, interpret_string, 4)
SCM
-Text_item::interpret_string (SCM paper_smob,
+Text_interface::interpret_string (SCM paper_smob,
SCM props, SCM input_encoding, SCM markup)
{
Output_def *paper = unsmob_output_def (paper_smob);
}
-MAKE_SCHEME_CALLBACK (Text_item, interpret_markup, 3)
+MAKE_SCHEME_CALLBACK (Text_interface, interpret_markup, 3)
SCM
-Text_item::interpret_markup (SCM paper_smob, SCM props, SCM markup)
+Text_interface::interpret_markup (SCM paper_smob, SCM props, SCM markup)
{
if (scm_is_string (markup))
return interpret_string (paper_smob, props, SCM_EOL, markup);
return SCM_EOL;
}
-MAKE_SCHEME_CALLBACK (Text_item,print,1);
+MAKE_SCHEME_CALLBACK (Text_interface,print,1);
SCM
-Text_item::print (SCM grob)
+Text_interface::print (SCM grob)
{
Grob *me = unsmob_grob (grob);
/* Ugh. Duplicated from Scheme. */
bool
-Text_item::markup_p (SCM x)
+Text_interface::markup_p (SCM x)
{
return (scm_is_string (x)
|| (ly_c_pair_p (x)
ly_symbol2scm ("markup-signature"))));
}
-ADD_INTERFACE (Text_item,"text-interface",
+ADD_INTERFACE (Text_interface,"text-interface",
"A scheme markup text, see @usermanref{Text-markup}.",
"text baseline-skip word-space");
SCM text = index_get_cell (edge_text, d);
- if (Text_item::markup_p (text))
- edge[d] = *unsmob_stencil (Text_item::interpret_markup (paper->self_scm (), properties, text));
+ if (Text_interface::markup_p (text))
+ edge[d] = *unsmob_stencil (Text_interface::interpret_markup (paper->self_scm (), properties, text));
if (!edge[d].is_empty ())
edge[d].align_to (Y_AXIS, CENTER);
ly_symbol2scm ("fetaNumber"))),
chain);
- SCM sn = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
+ SCM sn = Text_interface::interpret_markup (me->get_paper ()->self_scm (), chain,
scm_makfrom0str (to_string (num).to_str0 ()));
- SCM sd = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
+ SCM sd = Text_interface::interpret_markup (me->get_paper ()->self_scm (), chain,
scm_makfrom0str (to_string (den).to_str0 ()));
Stencil n = *unsmob_stencil (sn);
if (scm_is_string (number) && number_visibility)
{
SCM properties = Font_interface::text_font_alist_chain (me);
- SCM snum = Text_item::interpret_markup (pap->self_scm (), properties, number);
+ SCM snum = Text_interface::interpret_markup (pap->self_scm (), properties, number);
num = *unsmob_stencil (snum);
num.align_to (X_AXIS, CENTER);
num.translate_axis (w/2, X_AXIS);
{
SCM text = me->get_property ("text");
SCM properties = me->get_property_alist_chain (SCM_EOL);
- SCM snum = Text_item::interpret_markup (paper->self_scm (), properties, text);
+ SCM snum = Text_interface::interpret_markup (paper->self_scm (), properties, text);
Stencil num = *unsmob_stencil (snum);
mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
(BarNumber
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(breakable . #t)
(break-visibility . ,begin-of-line-visible)
(padding . 1.0)
(BassFigure
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(Y-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(direction . 1)
(font-family . number)
(first-note . (fixed-space . 1.0)) ;huh?
(right-edge . (extra-space . 0.1))
))
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(text . ,(make-musicglyph-markup "scripts-rcomma"))
(Y-offset-callbacks . (,Breathing_sign::offset_callback))
(break-visibility . ,begin-of-line-invisible)
(ChordName
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(after-line-breaking-callback . ,Chord_name::after_line_breaking)
(word-space . 0.0)
(font-family . sans)
(DynamicText
. (
(Y-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self
,Self_alignment_interface::centered_on_parent))
(self-alignment-X . 0)
(Fingering
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
; sync with TextScript (?)
(padding . 0.5)
))
(self-alignment-Y . 0)
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(break-align-symbol . instrument-name)
(break-visibility . ,begin-of-line-visible)
(baseline-skip . 2)
(space-alist . ((left-edge . (extra-space . 1.0))
))
(break-align-symbol . instrument-name)
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(break-align-symbol . clef)
(break-visibility . ,begin-of-line-visible)
(baseline-skip . 2)
))
(LyricText
- . ((print-function . ,Text_item::print)
+ . ((print-function . ,Text_interface::print)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_parent))
(self-alignment-X . 0)
(word-space . 0.6)
(RehearsalMark
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(after-line-breaking-callback . ,shift-right-at-line-begin)
))
(MetronomeMark
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(direction . 1)
(padding . 0.8)
(MultiMeasureRestNumber
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self
,Self_alignment_interface::centered_on_other_axis_parent))
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
))
(MultiMeasureRestText
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self
,Self_alignment_interface::centered_on_other_axis_parent))
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(NoteName
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(meta . ((interfaces . (note-name-interface
text-interface font-interface item-interface ))))
))
(break-visibility . ,begin-of-line-visible)
(X-offset-callbacks . (,Self_alignment_interface::centered_on_parent ,Self_alignment_interface::aligned_on_self))
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
;; no Y dimensions, because of lyrics under tenor clef.
(Y-extent . (0 . 0))
))
(StanzaNumber
- . ((print-function . ,Text_item::print)
+ . ((print-function . ,Text_interface::print)
(font-series . bold)
(padding . 1.0)
(X-offset-callbacks . (,Side_position_interface::aligned_side))
(SostenutoPedal
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(direction . 1)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(no-spacing-rods . #t)
(TextScript
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(no-spacing-rods . #t)
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(direction . -1)
))
(CombineTextScript
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(no-spacing-rods . #t)
(Y-offset-callbacks . (,Side_position_interface::aligned_side))
(X-offset-callbacks . (,Self_alignment_interface::aligned_on_self))
(TabNoteHead
. (
(style . default)
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
(extra-offset . (0 . -0.65)) ;; UGH! TODO: Clean this up!
(stem-attachment-function . ,tablature-stem-attachment-function)
(TimeSignature
. (
(print-function . ,Time_signature::print)
-; (print-function . ,Text_item::print)
+; (print-function . ,Text_interface::print)
(break-align-symbol . time-signature)
(break-visibility . ,all-visible)
(space-alist . (
(UnaCordaPedal
. (
- (print-function . ,Text_item::print)
+ (print-function . ,Text_interface::print)
(font-shape . italic)
(no-spacing-rods . #t)
(self-alignment-X . 0)
(def-markup-command (encoded-simple paper props sym str) (symbol? string?)
"A text string, encoded with encoding @var{sym}. See
@usermanref{Text encoding} for more information."
- (Text_item::interpret_string paper
+ (Text_interface::interpret_string paper
props sym str))
"Create a box of the same height as the space in the current font."
- (let ((m (Text_item::interpret_markup paper props " ")))
+ (let ((m (Text_interface::interpret_markup paper props " ")))
(ly:stencil-set-extent! m X '(1000 . -1000))
m))
"Make a markup letter for @var{num}. The letters start with A to Z
(skipping I), and continues with double letters."
- (Text_item::interpret_markup paper props (number->markletter-string num)))
+ (Text_interface::interpret_markup paper props (number->markletter-string num)))
(make-line-markup (list-insert-separator markups sep))
empty-markup))
-(define-public brew-new-markup-stencil Text_item::print)
-(define-public interpret-markup Text_item::interpret_markup)
+(define-public brew-new-markup-stencil Text_interface::print)
+(define-public interpret-markup Text_interface::interpret_markup)
(define-public (prepend-alist-chain key val chain)
(cons (acons key val (car chain)) (cdr chain)))
Sustain_pedal::print
System_start_delimiter::after_line_breaking
System_start_delimiter::print
- Text_item::print
+ Text_interface::print
Text_spanner::print
Tie::print
Tie_column::after_line_breaking
str = re.sub (r'Text_item', 'Text_interface', str)
return str
-conversions.append (((2, 3, 18), conv,
+conversions.append (((2, 3, 18),
+ conv,
'''Text_item -> Text_interface''' )
################################