From b0d10f15ca87e1cf26d9fe1d46114c843bdb083f Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Tue, 19 Dec 2006 10:54:50 +0200 Subject: [PATCH] replace no-spacing-rods with extra-spacing-width and add infinite-spacing-height to fix fatText --- Documentation/user/programming-interface.itely | 2 +- Documentation/user/tweaks.itely | 2 +- Documentation/user/working.itely | 14 +++++++------- lily/item.cc | 3 ++- lily/separation-item.cc | 11 ++++++----- ly/property-init.ly | 7 +++++-- scm/define-grob-properties.scm | 6 ++++-- scm/define-grobs.scm | 13 +++++++------ 8 files changed, 33 insertions(+), 25 deletions(-) diff --git a/Documentation/user/programming-interface.itely b/Documentation/user/programming-interface.itely index 9a62200bba..1cadde8f2e 100644 --- a/Documentation/user/programming-interface.itely +++ b/Documentation/user/programming-interface.itely @@ -123,7 +123,7 @@ tempoMark = #(define-music-function (parser location padding marktext) (number? string?) #{ \once \override Score . RehearsalMark #'padding = $padding - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $marktext } #}) diff --git a/Documentation/user/tweaks.itely b/Documentation/user/tweaks.itely index bbef69b00b..b26704c13c 100644 --- a/Documentation/user/tweaks.itely +++ b/Documentation/user/tweaks.itely @@ -460,7 +460,7 @@ tempoMark = #(define-music-function (parser location padding marktext) (number? string?) #{ \once \override Score . RehearsalMark #'padding = $padding - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $marktext } #}) diff --git a/Documentation/user/working.itely b/Documentation/user/working.itely index 2872272a9f..ff343cf51e 100644 --- a/Documentation/user/working.itely +++ b/Documentation/user/working.itely @@ -298,7 +298,7 @@ mpdolce = #(make-dynamic-script (markup #:hspace 1 #:translate (cons 5 0) tempoMark = #(define-music-function (parser location markp) (string?) #{ \once \override Score . RehearsalMark #'self-alignment-X = #left - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $markp } #}) @@ -326,7 +326,7 @@ mpdolce = #(make-dynamic-script (markup #:hspace 1 #:translate (cons 5 0) tempoMark = #(define-music-function (parser location markp) (string?) #@{ \once \override Score . RehearsalMark #'self-alignment-X = #left - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup @{ \bold $markp @} #@}) @end example @@ -354,7 +354,7 @@ mpdolce = #(make-dynamic-script (markup #:hspace 1 #:translate (cons 5 0) tempoMark = #(define-music-function (parser location markp) (string?) #{ \once \override Score . RehearsalMark #'self-alignment-X = #left - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $markp } #}) @@ -383,7 +383,7 @@ mpdolce = #(make-dynamic-script (markup #:hspace 1 #:translate (cons 5 0) tempoMark = #(define-music-function (parser location markp) (string?) #@{ \once \override Score . RehearsalMark #'self-alignment-X = #left - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup @{ \bold $markp @} #@}) @@ -408,7 +408,7 @@ mpdolce = #(make-dynamic-script (markup #:hspace 1 #:translate (cons 5 0) tempoMark = #(define-music-function (parser location markp) (string?) #{ \once \override Score . RehearsalMark #'self-alignment-X = #left - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $markp } #}) @@ -450,7 +450,7 @@ mpdolce = #(make-dynamic-script (markup #:hspace 1 #:translate (cons 5 0) tempoMark = #(define-music-function (parser location markp) (string?) #@{ \once \override Score . RehearsalMark #'self-alignment-X = #left - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup @{ \bold $markp @} #@}) @@ -475,7 +475,7 @@ mpdolce = #(make-dynamic-script (markup #:hspace 1 #:translate (cons 5 0) tempoMark = #(define-music-function (parser location markp) (string?) #{ \once \override Score . RehearsalMark #'self-alignment-X = #left - \once \override Score . RehearsalMark #'no-spacing-rods = ##t + \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $markp } #}) diff --git a/lily/item.cc b/lily/item.cc index 173df20ed8..5cf717a300 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -233,5 +233,6 @@ ADD_INTERFACE (Item, /* properties */ "break-visibility " - "no-spacing-rods " + "extra-spacing-width " + "infinite-spacing-height " "non-musical") diff --git a/lily/separation-item.cc b/lily/separation-item.cc index 0a6c085afc..0867007375 100644 --- a/lily/separation-item.cc +++ b/lily/separation-item.cc @@ -109,14 +109,15 @@ Separation_item::boxes (Grob *me, Grob *left) continue; } - if (to_boolean (il->get_property ("no-spacing-rods"))) - continue; - Interval y (il->pure_height (ycommon, 0, very_large)); Interval x (il->extent (pc, X_AXIS)); - SCM padding = elts[i]->get_property ("padding"); - x.widen (robust_scm2double (padding, 0)); + Interval extra = robust_scm2interval (elts[i]->get_property ("extra-spacing-width"), + Interval (0, 0)); + x[LEFT] += extra[LEFT]; + x[RIGHT] += extra[RIGHT]; + if (to_boolean (elts[i]->get_property ("infinite-spacing-height"))) + y = Interval (-infinity_f, infinity_f); out.push_back (Box (x, y)); } diff --git a/ly/property-init.ly b/ly/property-init.ly index 10e301af30..f7fc11ae73 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -123,8 +123,11 @@ endincipit = \context Staff { autoBeamOff = \set autoBeaming = ##f autoBeamOn = \set autoBeaming = ##t -fatText = \override TextScript #'no-spacing-rods = ##f -emptyText = \override TextScript #'no-spacing-rods = ##t +fatText = { \override TextScript #'extra-spacing-width = #'(0 . 0) + \override TextScript #'infinite-spacing-height = ##t } + +emptyText = { \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0) + \override TextScript #'infinite-spacing-height = ##f } showStaffSwitch = \set followVoice = ##t hideStaffSwitch = \set followVoice = ##f diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index b46dc5aae7..b9012c52d7 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -141,6 +141,7 @@ edges '(@var{left-text} . @var{right-text}).") (extra-X-extent ,number-pair? "A grob is enlarged in X dimension by this much.") (extra-Y-extent ,number-pair? "See @code{extra-X-extent}.") + (extra-spacing-width ,number-pair? "In the horizontal spacing problem, we pad each item by this amount (by adding the car on the left side of the item and adding the cdr on the right side of the item). In order to make a grob take up no horizontal space at all, set this to (+inf.0 . -inf.0)") (X-extent ,number-pair? "Hard coded extent in X direction. ") (Y-extent ,number-pair? "See @code{X-extent}.") (extra-offset ,number-pair? "A pair representing an offset. This @@ -202,6 +203,9 @@ of note-column for horizontal shifting. This is used by Choices are @code{around}, @code{inside}, @code{outside}. If unset, script and slur ignore eachother.") (ignore-collision ,boolean? "If set, don't do note collision resolution on this NoteColumn.") + (infinite-spacing-height ,boolean? "If true, then for the purposes of +horizontal spacing, treat this item as though it were infinitely tall. That +is, no object from another column will be allowed to stick above or below this item.") (inspect-quants ,number-pair? "If debugging is set, set beam/slur quant to this position, and print the respective scores.") (inspect-index ,integer? "If debugging is set, @@ -269,8 +273,6 @@ to flip the direction of custos stem.") (note-names ,vector? "Vector of strings containing names for easy-notation note heads.") (no-ledgers ,boolean? "If set, don't draw ledger lines on this object.") - (no-spacing-rods ,boolean? "Items with this property do not cause -spacing constraints.") (no-stem-extend ,boolean? "If set, notes with ledger lines do not get stems extending to the middle staff line.") (non-musical ,boolean? "True if the grob belongs in a NonMusicalPaperColumn.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 47ef19a696..f258856924 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -161,6 +161,7 @@ (layer . 0) (break-visibility . ,all-visible) (non-musical . #t) + (extra-spacing-width . (-0.3 . 0.3)) (stencil . ,ly:bar-line::print) (glyph-name . ,bar-line::calc-glyph-name) @@ -475,7 +476,7 @@ (CombineTextScript . ( (stencil . ,ly:text-interface::print) - (no-spacing-rods . #t) + (extra-spacing-width . (+inf.0 . -inf.0)) (Y-offset . ,ly:side-position-interface::y-aligned-side) (X-offset . ,ly:self-alignment-interface::x-aligned-on-self) (direction . ,UP) @@ -601,7 +602,7 @@ (font-encoding . fetaDynamic) (font-shape . italic) (avoid-slur . around) - (no-spacing-rods . #t) + (extra-spacing-width . (+inf.0 . -inf.0)) (outside-staff-priority . 250) (meta . ((class . Item) (interfaces . (font-interface @@ -1412,7 +1413,7 @@ (stencil . ,ly:text-interface::print) (direction . ,RIGHT) (X-offset . ,ly:self-alignment-interface::x-aligned-on-self) - (no-spacing-rods . #t) + (extra-spacing-width . (+inf.0 . -inf.0)) (padding . 0.0) ;; padding relative to SostenutoPedalLineSpanner (font-shape . italic) (self-alignment-X . 0) @@ -1618,7 +1619,7 @@ (SustainPedal . ( - (no-spacing-rods . #t) + (extra-spacing-width . (+inf.0 . -inf.0)) (stencil . ,ly:sustain-pedal::print) (self-alignment-X . 0) (direction . ,RIGHT) @@ -1736,7 +1737,7 @@ (TextScript . ( - (no-spacing-rods . #t) + (extra-spacing-width . (+inf.0 . -inf.0)) (X-offset . ,ly:self-alignment-interface::x-aligned-on-self) (Y-offset . ,ly:side-position-interface::y-aligned-side) (side-axis . ,Y) @@ -1931,7 +1932,7 @@ . ( (stencil . ,ly:text-interface::print) (font-shape . italic) - (no-spacing-rods . #t) + (extra-spacing-width . (+inf.0 . -inf.0)) (self-alignment-X . 0) (direction . ,RIGHT) (padding . 0.0) ;; padding relative to UnaCordaPedalLineSpanner -- 2.39.5