From: Han-Wen Nienhuys Date: Thu, 6 Oct 2005 13:12:57 +0000 (+0000) Subject: (AncientRemoveEmptyStaffContext): switch on X-Git-Tag: release/2.7.12~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=913f4a33e9b60b94e673ae48c1fb299f1465b4ad;p=lilypond.git (AncientRemoveEmptyStaffContext): switch on New_figured_bass_engraver by default. --- diff --git a/ChangeLog b/ChangeLog index faf12b528a..e8a659cbed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-10-06 Han-Wen Nienhuys + * 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 diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index b5b64edbbd..2757cc52e7 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -77,6 +77,9 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis) return ly_interval2scm (r - my_coord); } +/* + FIXME: junk this. + */ void Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2) { diff --git a/lily/figured-bass-continuation.cc b/lily/figured-bass-continuation.cc index 951807440f..766dc49818 100644 --- a/lily/figured-bass-continuation.cc +++ b/lily/figured-bass-continuation.cc @@ -118,11 +118,13 @@ Figured_bass_continuation::print (SCM grob) - 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 (); } @@ -133,6 +135,7 @@ ADD_INTERFACE(Figured_bass_continuation, /* props */ "thickness " + "padding " "figures " ); diff --git a/lily/new-figured-bass-engraver.cc b/lily/new-figured-bass-engraver.cc index 3ef1e29ea4..f3186193ec 100644 --- a/lily/new-figured-bass-engraver.cc +++ b/lily/new-figured-bass-engraver.cc @@ -58,7 +58,7 @@ protected: virtual bool try_music (Music *); virtual void derived_mark () const; - + void start_translation_timestep (); void stop_translation_timestep (); void process_music (); @@ -86,7 +86,7 @@ New_figured_bass_engraver::stop_translation_timestep () found = found || groups_[i].current_music_; if (!found) - clear_spanners (); + clear_spanners (); } New_figured_bass_engraver::New_figured_bass_engraver () @@ -226,41 +226,49 @@ New_figured_bass_engraver::process_music () 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++) { @@ -275,6 +283,7 @@ New_figured_bass_engraver::process_music () Item *item = make_item ("NewBassFigure", group.current_music_->self_scm ()); + SCM fig = group.current_music_->get_property ("figure"); if (!group.group_) { diff --git a/lily/text-interface.cc b/lily/text-interface.cc index 7a4dcc1899..a940c4e452 100644 --- a/lily/text-interface.cc +++ b/lily/text-interface.cc @@ -55,8 +55,10 @@ Text_interface::interpret_markup (SCM layout_smob, SCM props, SCM markup) } 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 (); diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index b96ee5eada..1fec13a6af 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -596,7 +596,8 @@ AncientRemoveEmptyStaffContext = \context { \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" diff --git a/scm/bass-figure.scm b/scm/bass-figure.scm index 5900673cd8..dd71afdb6e 100644 --- a/scm/bass-figure.scm +++ b/scm/bass-figure.scm @@ -14,27 +14,49 @@ (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. diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index d5f68bb606..c15d080aa4 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -208,12 +208,12 @@ (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)) @@ -238,7 +238,7 @@ (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)