X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Foutput-lib.scm;h=b82ffa2c4c42e3ceed980e8397735f2986c01dd7;hb=a0c14edf3e0f4efcc16be3bee4f6eda30b256a47;hp=22e4377046c47ed3034bea7a7c52ebc9a055a2a3;hpb=f7a94e42bd0449113b115ecadd888f05ee76f510;p=lilypond.git diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 22e4377046..b82ffa2c4c 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -2,7 +2,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 1998--2007 Jan Nieuwenhuizen +;;;; (c) 1998--2009 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys @@ -202,6 +202,15 @@ centered, X==1 is at the right, X == -1 is at the left." (define-public (first-bar-number-invisible barnum) (> barnum 1)) +(define-public (all-bar-numbers-visible barnum) #t) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; percent repeat counters + +(define-public ((every-nth-repeat-count-visible n) count context) (= 0 (modulo count n))) + +(define-public (all-repeat-counts-visible count context) #t) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; break visibility @@ -243,6 +252,7 @@ centered, X==1 is at the right, X == -1 is at the left." ("" . ("" . "")) (":" . (":" . "")) ("." . ("." . ())) + ("'" . ("'" . ())) ("empty" . (() . ())) ("brace" . (() . "brace")) ("bracket" . (() . "bracket")) @@ -530,6 +540,8 @@ centered, X==1 is at the right, X == -1 is at the left." left-span X) X)) (common-y (ly:grob-common-refpoint spanner left-span Y)) + (minimum-length (ly:grob-property spanner 'minimum-length 0.5)) + (left-x (+ padding (max (interval-end (ly:grob-robust-relative-extent left-span common X)) @@ -540,9 +552,9 @@ centered, X==1 is at the right, X == -1 is at the left." (interval-end (ly:grob-robust-relative-extent dots common X)) -10000) ;; TODO: use real infinity constant. ))) - (right-x (- (interval-start - (ly:grob-robust-relative-extent right-span common X)) - padding)) + (right-x (max (- (interval-start (ly:grob-robust-relative-extent right-span common X)) + padding) + (+ left-x minimum-length))) (self-x (ly:grob-relative-coordinate spanner common X)) (dx (- right-x left-x)) (exp (list 'path thickness @@ -662,4 +674,21 @@ centered, X==1 is at the right, X == -1 is at the left." (define-public (script-interface::calc-x-offset grob) (ly:grob-property grob 'positioning-done) - (ly:self-alignment-interface::centered-on-x-parent grob)) + (let* ((shift (ly:grob-property grob 'toward-stem-shift 0.0)) + (note-head-location (ly:self-alignment-interface::centered-on-x-parent grob)) + (note-head-grob (ly:grob-parent grob X)) + (stem-grob (ly:grob-object note-head-grob 'stem))) + (+ note-head-location + ;; If the property 'toward-stem-shift is defined and the script has the + ;; same direction as the stem, move the script accordingly. Since scripts can + ;; also be over skips, we need to check whether the grob has a stem at all. + (if (ly:grob? stem-grob) + (let ((dir1 (ly:grob-property grob 'direction)) + (dir2 (ly:grob-property stem-grob 'direction))) + (if (equal? dir1 dir2) + (let* ((common-refp (ly:grob-common-refpoint grob stem-grob X)) + (stem-location (ly:grob-relative-coordinate stem-grob common-refp X))) + (* shift (- stem-location + note-head-location))) + 0.0)) + 0.0))))