New_figured_bass_engraver by default.
2005-10-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * ly/engraver-init.ly (AncientRemoveEmptyStaffContext): switch on
+ New_figured_bass_engraver by default.
+
* lily/ttf.cc (print_trailer): only define glyph names when
FT_Face has FT_FACE_FLAG_GLYPH_NAMES
return ly_interval2scm (r - my_coord);
}
+/*
+ FIXME: junk this.
+ */
void
Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2)
{
- me->relative_coordinate (common, X_AXIS);
}
while (flip (&d) != LEFT);
+ spanned.widen (- robust_scm2double (me->get_property ("padding"), 0.2));
- Stencil extender
- = Line_interface::make_line (thick,
- Offset (spanned[LEFT], 0),
- Offset (spanned[RIGHT], 0));
+ Stencil extender;
+ if (!spanned.is_empty ())
+ extender = Line_interface::make_line (thick,
+ Offset (spanned[LEFT], 0),
+ Offset (spanned[RIGHT], 0));
return extender.smobbed_copy ();
}
/* props */
"thickness "
+ "padding "
"figures "
);
virtual bool try_music (Music *);
virtual void derived_mark () const;
-
+
void start_translation_timestep ();
void stop_translation_timestep ();
void process_music ();
found = found || groups_[i].current_music_;
if (!found)
- clear_spanners ();
+ clear_spanners ();
}
New_figured_bass_engraver::New_figured_bass_engraver ()
Figure_group group;
groups_.push (group);
}
-
groups_[k].current_music_ = new_musics_[i];
groups_[k].figure_item_ = 0;
k++;
}
- SCM proc = get_property ("newFiguredBassFormatter");
-
- alignment_->set_bound (RIGHT, muscol);
- if (to_boolean (get_property ("useBassFigureExtenders")))
- for (int i = 0; i < groups_.size(); i++)
+ for (int i = 0; i < groups_.size (); i++)
{
- if (groups_[i].is_continuation_)
+ if (!groups_[i].is_continuation_)
{
- if (!groups_[i].continuation_line_)
- {
- Spanner * line = make_spanner ("BassFigureContinuation", SCM_EOL);
- Item * item = groups_[i].figure_item_;
- groups_[i].continuation_line_ = line;
- line->set_bound (LEFT, item);
-
- /*
- Don't add as child. This will cache the wrong
- (pre-break) stencil when callbacks are triggered.
- */
- line->set_parent (groups_[i].group_, Y_AXIS);
- Pointer_group_interface::add_grob (line, ly_symbol2scm ("figures"), item);
-
- groups_[i].figure_item_ = 0;
- }
+ groups_[i].number_ = SCM_BOOL_F;
+ groups_[i].alteration_ = SCM_BOOL_F;
}
- else
- groups_[i].continuation_line_ = 0;
}
+
+ SCM proc = get_property ("newFiguredBassFormatter");
+ alignment_->set_bound (RIGHT, muscol);
+
+ if (to_boolean (get_property ("useBassFigureExtenders")))
+ for (int i = 0; i < groups_.size(); i++)
+ {
+ if (groups_[i].is_continuation_)
+ {
+ if (!groups_[i].continuation_line_)
+ {
+ Spanner * line = make_spanner ("BassFigureContinuation", SCM_EOL);
+ Item * item = groups_[i].figure_item_;
+ groups_[i].continuation_line_ = line;
+ line->set_bound (LEFT, item);
+
+ /*
+ Don't add as child. This will cache the wrong
+ (pre-break) stencil when callbacks are triggered.
+ */
+ line->set_parent (groups_[i].group_, Y_AXIS);
+ Pointer_group_interface::add_grob (line, ly_symbol2scm ("figures"), item);
+
+ groups_[i].figure_item_ = 0;
+ }
+ }
+ else
+ groups_[i].continuation_line_ = 0;
+ }
for (int i = 0; i < groups_.size(); i++)
{
Item *item
= make_item ("NewBassFigure",
group.current_music_->self_scm ());
+
SCM fig = group.current_music_->get_property ("figure");
if (!group.group_)
{
}
else
{
- programming_error ("not a markup: ");
+ programming_error ("Object is not a markup. ");
+ scm_puts ("This object should be a markup: ", scm_current_error_port ());
scm_display (markup, scm_current_error_port ());
+ scm_puts ("\n", scm_current_error_port ());
Box b;
b[X_AXIS].set_empty ();
\type "Engraver_group"
\name FiguredBass
- \consists "Figured_bass_engraver"
+%% \consists "Figured_bass_engraver"
+ \consists "New_figured_bass_engraver"
\consists "Note_swallow_translator"
\consists "Skip_event_swallow_translator"
\consists "Separating_line_group_engraver"
(define-public (format-new-bass-figure figure event context)
(let* ((fig (ly:music-property event 'figure))
- (fig-markup (markup #:number (number->string figure 10)))
+ (fig-markup (if (number? figure)
+ (markup #:number (number->string figure 10))
+ #f
+ ))
(alt (ly:music-property event 'alteration))
(alt-markup
(if (number? alt)
- (alteration->text-accidental-markup alt)
+ (markup
+ #:general-align Y DOWN #:smaller #:smaller
+ (alteration->text-accidental-markup alt))
+
#f))
(alt-dir (ly:context-property context 'figuredBassAlterationDirection))
-
)
+
+ (if (and (not fig-markup) alt-markup)
+ (begin
+ (set! fig-markup (markup #:left-align #:pad-around 0.3 alt-markup))
+ (set! alt-markup #f)))
+
+
+ ;; hmm, how to get figures centered between note, and
+ ;; lone accidentals too?
+ ;; (if (markup? fig-markup)
+ ;; (set!
+ ;; fig-markup (markup #:translate (cons 1.0 0)
+ ;; #:hcenter fig-markup)))
+
(if alt-markup
(set! fig-markup
- (markup #:put-adjacent fig-markup X
+ (markup #:put-adjacent
+ fig-markup X
(if (number? alt-dir)
alt-dir
LEFT)
- #:raise .33
- #:pad-around 0.5 #:smaller alt-markup )))
+ #:pad-around 0.2 alt-markup
+ )))
- fig-markup))
+ (if (markup? fig-markup)
+ fig-markup
+ empty-markup)))
(define-public (format-bass-figure figures context grob)
;; TODO: support slashed numerals here.
(NewBassFigure
. (
(print-function . ,Text_interface::print)
+ (font-size . -2)
(meta . ((class . Item)
(interfaces . (text-interface
rhythmic-grob-interface
bass-figure-interface
font-interface))))))
-
(BassFigureBracket
. ((print-function . ,Figured_bass_bracket::print)
(edge-height . (0.2 . 0.2))
(BassFigureAlignment
. (
(axes . (,Y))
- (threshold . (2.4 . 1000))
+ (threshold . (2 . 1000))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(stacking-dir . -1)
(meta . ((class . Spanner)