out_of_staff() correctly for d == DOWN.
* lily/text-spanner.cc (brew_molecule): only put vertical line and
horizontal line if they move to the right.
* scm/define-grobs.scm (all-grob-descriptions): set
text-repeat-if-broken for ottava spanner
* lily/text-spanner.cc (brew_molecule): text-repeat-if-broken
property.
2004-01-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
2004-01-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/side-position-interface.cc (out_of_staff): also do
+ out_of_staff() correctly for d == DOWN.
+
+ * lily/text-spanner.cc (brew_molecule): only put vertical line and
+ horizontal line if they move to the right.
+
+ * scm/define-grobs.scm (all-grob-descriptions): set
+ text-repeat-if-broken for ottava spanner
+
+ * lily/text-spanner.cc (brew_molecule): text-repeat-if-broken
+ property.
+
* mf/feta18.mf: design size is 18 not 22.5
* lily/new-lyric-combine-music-iterator.cc (process): new file.
* mf/feta18.mf: design size is 18 not 22.5
* lily/new-lyric-combine-music-iterator.cc (process): new file.
\header
{
texidoc = "Ottava brackets are supported, through the
\header
{
texidoc = "Ottava brackets are supported, through the
-use of the scheme function @code{set-octavation}.
+use of the scheme function @code{set-octavation}.
+
+The spanner should go below for 8va bassa, and the string can be tuned
+with @code{Staff.ottavation}.
+
\score {
\notes\relative c''' \notes {
a b c a
\score {
\notes\relative c''' \notes {
a b c a
+ #(set-octavation 1)
+ a b c a
+ #(set-octavation 0)
-
- a, #(set-octavation 1) b
+ #(set-octavation -1)
+ a b c a
+ #(set-octavation 0)
+ a,
+ #(set-octavation 1)
+ \property Staff.ottavation = #"8"
+ b
#(set-octavation 0)
c a
#(set-octavation -1) b a g
#(set-octavation 0)
#(set-octavation 0)
c a
#(set-octavation -1) b a g
#(set-octavation 0)
span_ = new Spanner (get_property ("OttavaSpanner"));
span_->set_grob_property ("edge-text", gh_cons (ott, SCM_EOL));
announce_grob (span_, SCM_EOL);
span_ = new Spanner (get_property ("OttavaSpanner"));
span_->set_grob_property ("edge-text", gh_cons (ott, SCM_EOL));
announce_grob (span_, SCM_EOL);
+
+ SCM c0 (get_property ("centralCPosition"));
+ SCM oc0 (get_property ("originalCentralCPosition"));
+ if (scm_less_p (oc0, c0) == SCM_BOOL_T)
+ span_->set_grob_property ("direction", gh_int2scm (DOWN));
last_ottavation_ = ott;
}
last_ottavation_ = ott;
}
- Side_position_interface::add_staff_support (finished_);
-
Interval staff_size = st->extent (common, Y_AXIS);
Interval me_ext = me->extent (common, a);
Real diff = d*staff_size[d] + padding - d*me_ext[-d];
Interval staff_size = st->extent (common, Y_AXIS);
Interval me_ext = me->extent (common, a);
Real diff = d*staff_size[d] + padding - d*me_ext[-d];
- return gh_double2scm (diff >? 0);
+ return gh_double2scm (d* (diff >? 0));
/*
TODO: this function is too long
/*
TODO: this function is too long
+
+
+ TODO: the string for ottava shoudl depend on the available space, ie.
+
+
+ Long: 15ma Short: 15ma Empty: 15
+ 8va 8va 8
+ 8va bassa 8ba 8
+
+
*/
SCM
Text_spanner::brew_molecule (SCM smob)
*/
SCM
Text_spanner::brew_molecule (SCM smob)
- /* Don't repeat edge text for broken end */
- if (broken[d])
+ if (!to_boolean (me->get_grob_property ("text-repeat-if-broken"))
+ && broken[d])
continue;
SCM text = index_get_cell (edge_text, d);
continue;
SCM text = index_get_cell (edge_text, d);
span_points[RIGHT] -= gh_scm2double (ly_cdr (ew));
}
span_points[RIGHT] -= gh_scm2double (ly_cdr (ew));
}
Real thick = paper->get_realvar (ly_symbol2scm ("linethickness"));
SCM st = me->get_grob_property ("thickness");
if (gh_number_p (st))
Real thick = paper->get_realvar (ly_symbol2scm ("linethickness"));
SCM st = me->get_grob_property ("thickness");
if (gh_number_p (st))
do
{
Interval ext = edge[d].extent (X_AXIS);
do
{
Interval ext = edge[d].extent (X_AXIS);
-
- edge[d].translate_axis (span_points[d], X_AXIS);
- m.add_molecule (edge[d]);
- edge_line[d].translate_axis (span_points[d], X_AXIS);
- m.add_molecule (edge_line[d]);
- span_points[d] += -d * ext[-d];
+ {
+ edge[d].translate_axis (span_points[d], X_AXIS);
+ m.add_molecule (edge[d]);
+ span_points[d] += -d * ext[-d];
+ }
+ }
+ while (flip (&d) != LEFT);
+ do
+ {
+ if (d* span_points[d] > d * edge[-d].extent(X_AXIS)[d])
+ {
+ edge_line[d].translate_axis (span_points[d], X_AXIS);
+ m.add_molecule (edge_line[d]);
+ }
}
while (flip (&d) != LEFT);
}
while (flip (&d) != LEFT);
- Molecule l =Line_spanner::line_molecule (me, thick,
- Offset (span_points[LEFT], 0),
- Offset (span_points[RIGHT], 0));
- m.add_molecule (l);
-
+ if (!span_points.is_empty ())
+ {
+ Molecule l =Line_spanner::line_molecule (me, thick,
+ Offset (span_points[LEFT], 0),
+ Offset (span_points[RIGHT], 0));
+ m.add_molecule (l);
+ }
m.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS);
return m.smobbed_copy ();
}
m.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS);
return m.smobbed_copy ();
}
ADD_INTERFACE (Text_spanner,"text-spanner-interface",
"generic text spanner",
ADD_INTERFACE (Text_spanner,"text-spanner-interface",
"generic text spanner",
- "dash-period if-text-padding dash-fraction edge-height bracket-flare edge-text shorten-pair style thickness enclose-bounds width-correct");
+ "text-repeat-if-broken dash-period if-text-padding dash-fraction edge-height bracket-flare edge-text shorten-pair style thickness enclose-bounds width-correct");
(grob-property-description 'stems grob-list? "list of stem objects, corresponding to the notes that the arpeggio has to be before.")
(grob-property-description 'stropha boolean? "is this neume a stropha?.")
(grob-property-description 'style symbol? "a string determining what style of glyph is typeset. Valid choices depend on the function that is reading this property. .")
(grob-property-description 'stems grob-list? "list of stem objects, corresponding to the notes that the arpeggio has to be before.")
(grob-property-description 'stropha boolean? "is this neume a stropha?.")
(grob-property-description 'style symbol? "a string determining what style of glyph is typeset. Valid choices depend on the function that is reading this property. .")
+(grob-property-description 'text-repeat-if-broken boolean?
+ "Repeat text on broken text-spanner?")
(grob-property-description 'text markup? "Text markup. See the
notation manual for more information.")
(grob-property-description 'thick-thickness number? "thickness, measured in stafflinethickness.")
(grob-property-description 'text markup? "Text markup. See the
notation manual for more information.")
(grob-property-description 'thick-thickness number? "thickness, measured in stafflinethickness.")
- (Y-offset-callbacks . (,Side_position_interface::aligned_side))
+ (Y-offset-callbacks . (,Side_position_interface::out_of_staff
+ ,Side_position_interface::aligned_side))
(molecule-callback . ,Text_spanner::brew_molecule)
(font-family . roman)
(molecule-callback . ,Text_spanner::brew_molecule)
(font-family . roman)
+ (text-repeat-if-broken . #t)
+ (shorten-pair . (0.0 . -0.6))
+ (staff-padding . 1.0)
(enclose-bounds . #t)
(width-correct . 0.0)
(style . dashed-line)
(enclose-bounds . #t)
(width-correct . 0.0)
(style . dashed-line)
+(define-public (make-grob-property-override grob gprop val)
+
+ "Make a Music expression that sets GPROP to VAL in GROB. Does a pop first,
+i.e. this is not an override"
+
+ (let* ((m (make-music-by-name 'OverrideProperty)))
+ (ly:set-mus-property! m 'symbol grob)
+ (ly:set-mus-property! m 'grob-property gprop)
+ (ly:set-mus-property! m 'grob-value val)
+
+ m
+
+ ))
(define-public (make-grob-property-revert grob gprop)
(define-public (make-grob-property-revert grob gprop)
(define (ottava-modify context)
(define (ottava-modify context)
- "Either reset centralCPosition to the stored original,
-or remember old centralCPosition, add OCTAVATION to centralCPosition,
-and set OTTAVATION to `8va', or whatever appropriate."
+ "Either reset centralCPosition to the stored original, or remember
+old centralCPosition, add OCTAVATION to centralCPosition, and set
+OTTAVATION to `8va', or whatever appropriate."
+
(if (number? (ly:get-context-property context 'centralCPosition))
(if (= octavation 0)
(if (number? (ly:get-context-property context 'centralCPosition))
(if (= octavation 0)