X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdefine-grobs.scm;h=5479401f32134ccebb5b0fbde0cb2d4dc1f5fd24;hb=81183099c749ee5c1160d12ba0cc747f04bee159;hp=4beeb04dbf6c9d60433ea19ccdcd1096f3a71d0b;hpb=f0978ed121192fee9bdf2453a325d98693148acf;p=lilypond.git diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 4beeb04dbf..5479401f32 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -80,6 +80,7 @@ (side-axis . ,Y) (staff-padding . 0.25) (stencil . ,ly:accidental-interface::print) + (use-skylines . #t) (X-extent . ,ly:accidental-interface::width) (X-offset . ,(ly:make-simple-closure `(,+ @@ -197,6 +198,7 @@ (break-align-anchor . ,ly:bar-line::calc-anchor) (break-align-symbol . staff-bar) (break-visibility . ,bar-line::calc-break-visibility) + (extra-spacing-height . ,pure-from-neighbor-interface::account-for-span-bar) (gap . 0.4) (glyph . "|") (glyph-name . ,bar-line::calc-glyph-name) @@ -224,9 +226,12 @@ (right-edge . (extra-space . 0.0)))) (stencil . ,ly:bar-line::print) (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) (interfaces . (bar-line-interface break-aligned-interface - font-interface)))))) + font-interface + pure-from-neighbor-interface)))))) (BarNumber . ( @@ -236,6 +241,7 @@ (break-visibility . ,begin-of-line-visible) (direction . ,UP) + (extra-spacing-width . (+inf.0 . -inf.0)) (font-family . roman) (font-size . -2) (non-musical . #t) @@ -276,7 +282,8 @@ (stacking-dir . ,DOWN) (Y-extent . ,ly:axis-group-interface::height) (meta . ((class . Spanner) - (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (object-callbacks . ((full-score-pure-minimum-translations . ,ly:align-interface::full-score-pure-minimum-translations) + (pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs))) (interfaces . (align-interface axis-group-interface @@ -329,6 +336,7 @@ ;; todo: clean this up a bit: the list is getting ;; rather long. (auto-knee-gap . 5.5) + (beam-segments . ,ly:beam::calc-beam-segments) (beam-thickness . 0.48) ; in staff-space ;; We have some unreferenced problems here. @@ -357,7 +365,6 @@ note-head-interface stem-interface time-signature-interface)) - (concaveness . ,ly:beam::calc-concaveness) (cross-staff . ,ly:beam::calc-cross-staff) (damping . 1) (details @@ -382,15 +389,8 @@ (gap . 0.8) (neutral-direction . ,DOWN) - (positions . ,(ly:make-simple-closure - (ly:make-simple-closure - (list chain-grob-member-functions - `(,cons 0 0) - ly:beam::calc-least-squares-positions - ly:beam::slope-damping - ly:beam::shift-region-to-valid - ly:beam::quanting - )))) + (positions . ,beam::place-broken-parts-individually) + (X-positions . ,ly:beam::calc-x-positions) ;; this is a hack to set stem lengths, if positions is set. (quantized-positions . ,ly:beam::set-stem-lengths) @@ -507,6 +507,7 @@ (font-size . 1.5) (stencil . ,ly:text-interface::print) (extra-spacing-height . (0.2 . -0.2)) + (extra-spacing-width . (-0.5 . 0.5)) (word-space . 0.0) (meta . ((class . Item) (interfaces . (chord-name-interface @@ -520,6 +521,7 @@ (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor) (break-align-symbol . clef) (break-visibility . ,begin-of-line-visible) + (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-at-beginning-of-line) (glyph-name . ,ly:clef::calc-glyph-name) (non-musical . #t) (space-alist . ((cue-clef . (extra-space . 2.0)) @@ -533,9 +535,12 @@ (stencil . ,ly:clef::print) (Y-offset . ,ly:staff-symbol-referencer::callback) (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) (interfaces . (break-aligned-interface clef-interface font-interface + pure-from-neighbor-interface staff-symbol-referencer-interface)))))) (ClusterSpanner @@ -584,6 +589,7 @@ (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor) (break-align-symbol . cue-clef) (break-visibility . ,begin-of-line-visible) + (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-at-beginning-of-line) (font-size . -4) (glyph-name . ,ly:clef::calc-glyph-name) (non-musical . #t) @@ -599,9 +605,12 @@ (stencil . ,ly:clef::print) (Y-offset . ,ly:staff-symbol-referencer::callback) (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) (interfaces . (break-aligned-interface clef-interface font-interface + pure-from-neighbor-interface staff-symbol-referencer-interface)))))) (CueEndClef @@ -610,6 +619,7 @@ (break-align-anchor . ,ly:break-aligned-interface::calc-extent-aligned-anchor) (break-align-symbol . cue-end-clef) (break-visibility . ,begin-of-line-invisible) + (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-at-beginning-of-line) (font-size . -4) (glyph-name . ,ly:clef::calc-glyph-name) (non-musical . #t) @@ -626,9 +636,12 @@ (stencil . ,ly:clef::print) (Y-offset . ,ly:staff-symbol-referencer::callback) (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) (interfaces . (break-aligned-interface clef-interface font-interface + pure-from-neighbor-interface staff-symbol-referencer-interface)))))) (Custos @@ -661,6 +674,7 @@ (Dots . ( + (avoid-slur . inside) (dot-count . ,dots::calc-dot-count) (staff-position . ,dots::calc-staff-position) (stencil . ,ly:dots::print) @@ -753,6 +767,8 @@ ;; todo. + (collision-bias . -2.0) + (collision-padding . 0.5) (direction . ,ly:script-interface::calc-direction) (extra-spacing-width . (+inf.0 . -inf.0)) (font-encoding . fetaText) @@ -767,6 +783,7 @@ (X-offset . ,ly:self-alignment-interface::x-aligned-on-self) (Y-offset . ,ly:self-alignment-interface::y-aligned-on-self) (meta . ((class . Item) + (object-callbacks . ((X-colliding-grobs . ,ly:self-alignment-interface::x-colliding-grobs))) (interfaces . (dynamic-interface dynamic-text-interface font-interface @@ -856,7 +873,7 @@ ;; sync with TextScript (?) (avoid-slur . around) - (cross-staff . ,ly:side-position-interface::calc-cross-staff) + (cross-staff . ,script-or-side-position-cross-staff) (direction . ,ly:script-interface::calc-direction) (font-encoding . fetaText) (font-size . -5) ; don't overlap when next to heads. @@ -891,7 +908,9 @@ . ( (annotation-balloon . #f) (annotation-line . #t) + (automatically-numbered . ,(grob::calc-property-by-copy 'automatically-numbered)) (break-visibility . ,inherit-y-parent-visibility) + (footnote . #t) (footnote-text . ,(grob::calc-property-by-copy 'footnote-text)) (stencil . ,ly:balloon-interface::print) (text . ,(grob::calc-property-by-copy 'text)) @@ -909,6 +928,8 @@ . ( (annotation-balloon . #f) (annotation-line . #t) + (automatically-numbered . ,(grob::calc-property-by-copy 'automatically-numbered)) + (footnote . #t) (footnote-text . ,(grob::calc-property-by-copy 'footnote-text)) (spanner-placement . ,LEFT) (stencil . ,ly:balloon-interface::print-spanner) @@ -1003,6 +1024,7 @@ . ( (after-line-breaking . ,ly:spanner::kill-zero-spanned-time) (bound-padding . 1.0) + (broken-bound-padding . ,ly:hairpin::broken-bound-padding) (circled-tip . #f) (grow-direction . ,hairpin::calc-grow-direction) (height . 0.6666) @@ -1084,15 +1106,19 @@ (key-signature . (extra-space . 0.5)) (cue-clef . (extra-space . 0.5)) (right-edge . (extra-space . 0.5)) - (first-note . (semi-fixed-space . 2.5)))) + (first-note . (fixed-space . 2.5)))) (stencil . ,ly:key-signature-interface::print) - (extra-spacing-width . (0.0 . 0.5)) + (extra-spacing-width . (0.0 . 1.0)) + (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-including-staff) (Y-offset . ,ly:staff-symbol-referencer::callback) (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) (interfaces . (break-aligned-interface font-interface key-cancellation-interface key-signature-interface + pure-from-neighbor-interface staff-symbol-referencer-interface)))))) (KeySignature @@ -1108,14 +1134,18 @@ (staff-bar . (extra-space . 1.1)) (cue-clef . (extra-space . 0.5)) (right-edge . (extra-space . 0.5)) - (first-note . (semi-fixed-space . 2.5)))) + (first-note . (fixed-space . 2.5)))) (stencil . ,ly:key-signature-interface::print) - (extra-spacing-width . (0.0 . 0.5)) + (extra-spacing-width . (0.0 . 1.0)) + (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-including-staff) (Y-offset . ,ly:staff-symbol-referencer::callback) (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) (interfaces . (break-aligned-interface font-interface key-signature-interface + pure-from-neighbor-interface staff-symbol-referencer-interface)))))) @@ -1184,7 +1214,6 @@ ;; a tuplet bracket. (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors) - (control-points . ,ly:tuplet-bracket::calc-control-points) (direction . ,UP) (edge-height . (0.7 . 0.7)) (padding . 2.0) @@ -1193,6 +1222,7 @@ (staff-padding . 0.25) (stencil . ,ly:tuplet-bracket::print) (thickness . 1.6) + (X-positions . ,ly:tuplet-bracket::calc-x-positions) (meta . ((class . Spanner) (interfaces . (line-interface tuplet-bracket-interface)))))) @@ -1281,7 +1311,7 @@ (MensuralLigature . ( (stencil . ,ly:mensural-ligature::print) - (thickness . 1.4) + (thickness . 1.3) (meta . ((class . Spanner) (interfaces . (font-interface mensural-ligature-interface)))))) @@ -1389,8 +1419,6 @@ (before-line-breaking . ,ly:paper-column::before-line-breaking) (full-measure-extra-space . 1.0) (horizontal-skylines . ,ly:separation-item::calc-skylines) - ;; sufficient padding to prevent ledger lines from moving over/under - (skyline-vertical-padding . 0.6) ;; (stencil . ,ly:paper-column::print) (keep-inside-line . #t) @@ -1609,6 +1637,7 @@ (springs-and-rods . ,ly:spanner::set-spacing-rods) (stencil . ,ly:slur::print) (thickness . 1.1) + (vertical-skylines . ,ly:slur::vertical-skylines) (Y-extent . ,ly:slur::height) (meta . ((class . Spanner) (interfaces . (slur-interface)))))) @@ -1731,6 +1760,7 @@ (staff-padding . 0.25) (stencil . ,ly:script-interface::print) + (use-skylines . #t) (X-offset . ,script-interface::calc-x-offset) (Y-offset . ,ly:side-position-interface::y-aligned-side) (meta . ((class . Item) @@ -1765,6 +1795,7 @@ (springs-and-rods . ,ly:spanner::set-spacing-rods) (stencil . ,ly:slur::print) (thickness . 1.2) + (vertical-skylines . ,ly:slur::vertical-skylines) (Y-extent . ,ly:slur::height) (meta . ((class . Spanner) (interfaces . (slur-interface)))))) @@ -1837,14 +1868,21 @@ (non-musical . #t) (stencil . ,ly:span-bar::print) (X-extent . ,ly:span-bar::width) - (Y-extent . ,ly:axis-group-interface::height) + (Y-extent . (+inf.0 . -inf.0)) (meta . ((class . Item) - (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) - (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs))) (interfaces . (bar-line-interface font-interface span-bar-interface)))))) + (SpanBarStub + . ( + (X-extent . ,grob::x-parent-width) + (Y-extent . ,(ly:make-unpure-pure-container #f ly:axis-group-interface::pure-height)) + (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) + (interfaces . (pure-from-neighbor-interface)))))) + (StaffGrouper . ( (staff-staff-spacing . ((basic-distance . 9) @@ -1929,12 +1967,11 @@ (direction . ,ly:stem::calc-direction) (duration-log . ,stem::calc-duration-log) - (length . ,ly:stem::calc-length) + (length . ,stem::length) (neutral-direction . ,DOWN) (positioning-done . ,ly:stem::calc-positioning-done) - (stem-begin-position . ,ly:stem::calc-stem-begin-position) - (stem-end-position . ,ly:stem::calc-stem-end-position) (stem-info . ,ly:stem::calc-stem-info) + (stem-begin-position . ,ly:stem::calc-stem-begin-position) (stencil . ,ly:stem::print) (thickness . 1.3) (X-extent . ,ly:stem::width) @@ -1944,6 +1981,14 @@ (meta . ((class . Item) (interfaces . (stem-interface)))))) + (StemStub + . ( + (X-extent . ,stem-stub::width) + (extra-spacing-height . ,stem-stub::extra-spacing-height) + (Y-extent . ,(ly:make-unpure-pure-container #f stem-stub::pure-height)) + (meta . ((class . Item) + (interfaces . ()))))) + (StemTremolo . ( (beam-thickness . 0.48) ; staff-space @@ -1952,12 +1997,21 @@ (stencil . ,ly:stem-tremolo::print) (style . ,ly:stem-tremolo::calc-style) (X-extent . ,ly:stem-tremolo::width) + (X-offset . ,(ly:make-simple-closure + `(,+ + ,(ly:make-simple-closure + (list ly:self-alignment-interface::centered-on-x-parent)) + ,(ly:make-simple-closure + (list ly:self-alignment-interface::x-aligned-on-self))))) + (Y-offset . ,ly:stem-tremolo::calc-y-offset) (meta . ((class . Item) - (interfaces . (stem-tremolo-interface)))))) + (interfaces . (self-alignment-interface + stem-tremolo-interface)))))) (StringNumber . ( (avoid-slur . around) + (cross-staff . ,script-or-side-position-cross-staff) (font-encoding . fetaText) (font-size . -5) ; don't overlap when next to heads. (padding . 0.5) @@ -2038,7 +2092,9 @@ (X-extent . ,ly:axis-group-interface::width) (Y-extent . ,ly:system::height) (meta . ((class . System) - (object-callbacks . ((pure-relevant-grobs . ,ly:system::calc-pure-relevant-grobs) + (object-callbacks . ((footnotes-before-line-breaking . ,ly:system::footnotes-before-line-breaking) + (footnotes-after-line-breaking . ,ly:system::footnotes-after-line-breaking) + (pure-relevant-grobs . ,ly:system::calc-pure-relevant-grobs) (pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common))) (interfaces . (axis-group-interface system-interface)))))) @@ -2142,7 +2198,7 @@ (TextScript . ( (avoid-slur . around) - (cross-staff . ,ly:script-interface::calc-cross-staff) + (cross-staff . ,script-or-side-position-cross-staff) (direction . ,DOWN) (extra-spacing-width . (+inf.0 . -inf.0)) (outside-staff-priority . 450) @@ -2249,18 +2305,22 @@ (break-align-symbol . time-signature) (break-align-anchor-alignment . ,LEFT) (break-visibility . ,all-visible) - (extra-spacing-height . (-1.0 . 1.0)) + (extra-spacing-height . ,pure-from-neighbor-interface::extra-spacing-height-including-staff) + (extra-spacing-width . (0.0 . 0.8)) (non-musical . #t) (space-alist . ( (cue-clef . (extra-space . 1.5)) - (first-note . (semi-fixed-space . 2.0)) + (first-note . (fixed-space . 2.0)) (right-edge . (extra-space . 0.5)) (staff-bar . (minimum-space . 2.0)))) (stencil . ,ly:time-signature::print) (style . C) (meta . ((class . Item) + (object-callbacks . ((pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common) + (pure-relevant-grobs . ,ly:pure-from-neighbor-interface::calc-pure-relevant-grobs))) (interfaces . (break-aligned-interface font-interface + pure-from-neighbor-interface time-signature-interface)))))) (TrillPitchAccidental @@ -2341,8 +2401,8 @@ (TupletBracket . ( + (avoid-scripts . #t) (connect-to-neighbor . ,ly:tuplet-bracket::calc-connect-to-neighbors) - (control-points . ,ly:tuplet-bracket::calc-control-points) (cross-staff . ,ly:tuplet-bracket::calc-cross-staff) (direction . ,ly:tuplet-bracket::calc-direction) (edge-height . (0.7 . 0.7)) @@ -2353,6 +2413,7 @@ (staff-padding . 0.25) (stencil . ,ly:tuplet-bracket::print) (thickness . 1.6) + (X-positions . ,ly:tuplet-bracket::calc-x-positions) (meta . ((class . Spanner) (interfaces . (line-interface @@ -2367,6 +2428,8 @@ (font-size . -2) (stencil . ,ly:tuplet-number::print) (text . ,tuplet-number::calc-denominator-text) + (X-offset . ,ly:tuplet-number::calc-x-offset) + (Y-offset . ,ly:tuplet-number::calc-y-offset) (meta . ((class . Spanner) (interfaces . (font-interface text-interface @@ -2426,7 +2489,8 @@ (X-extent . ,ly:axis-group-interface::width) (Y-extent . ,ly:axis-group-interface::height) (meta . ((class . Spanner) - (object-callbacks . ((Y-common . ,ly:axis-group-interface::calc-y-common) + (object-callbacks . ((full-score-pure-minimum-translations . ,ly:align-interface::full-score-pure-minimum-translations) + (Y-common . ,ly:axis-group-interface::calc-y-common) (pure-relevant-grobs . ,ly:axis-group-interface::calc-pure-relevant-grobs) (pure-Y-common . ,ly:axis-group-interface::calc-pure-y-common))) (interfaces . (align-interface @@ -2587,6 +2651,7 @@ ly:dots::print ly:clef::print ly:flag::print + ly:time-signature::print default-flag normal-flag mensural-flag @@ -2643,7 +2708,11 @@ (,ly:side-position-interface::y-aligned-side . ,ly:side-position-interface::pure-y-aligned-side) (,ly:slur::height . ,ly:slur::pure-height) (,ly:slur::outside-slur-callback . ,ly:slur::pure-outside-slur-callback) + (,ly:stem::calc-stem-begin-position . ,ly:stem::pure-calc-stem-begin-position) + (,ly:stem::calc-stem-end-position . ,ly:stem::pure-calc-stem-end-position) + (,stem::length . ,stem::pure-length) (,ly:stem::height . ,ly:stem::pure-height) + (,ly:stem-tremolo::calc-y-offset . ,ly:stem-tremolo::pure-calc-y-offset) (,ly:system::height . ,ly:system::calc-pure-height))) (define pure-functions @@ -2659,6 +2728,7 @@ (let ((extent-callback (ly:grob-property-data grob 'Y-extent))) (not (eq? #f (or + (ly:unpure-pure-container? extent-callback) (pair? extent-callback) (memq extent-callback pure-functions) (and @@ -2670,16 +2740,29 @@ (assq stencil pure-print-to-height-conversions) (ly:stencil? stencil))))))))) +;; hideous code dup below - to be cleaned up when call pure functino +;; is eliminated and lilypond works entirely from unpure-pure-containers + (define-public (call-pure-function unpure args start end) - (if (ly:simple-closure? unpure) - (ly:eval-simple-closure (car args) unpure start end) - (if (not (procedure? unpure)) - unpure - (if (memq unpure pure-functions) - (apply unpure args) - (let ((pure (assq unpure pure-conversions-alist))) - (if pure - (apply (cdr pure) - (append - (list (car args) start end) - (cdr args))))))))) + (if (ly:unpure-pure-container? unpure) + (let ((unpure (ly:unpure-pure-container-pure-part unpure))) + (if (ly:simple-closure? unpure) + (ly:eval-simple-closure (car args) unpure start end) + (if (not (procedure? unpure)) + unpure + (apply unpure + (append + (list (car args) start end) + (cdr args)))))) + (if (ly:simple-closure? unpure) + (ly:eval-simple-closure (car args) unpure start end) + (if (not (procedure? unpure)) + unpure + (if (memq unpure pure-functions) + (apply unpure args) + (let ((pure (assq unpure pure-conversions-alist))) + (if pure + (apply (cdr pure) + (append + (list (car args) start end) + (cdr args))))))))))