X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Foutput-lib.scm;h=53a5773d0f738e570b855b8a68e402c793fd23c5;hb=76e0955967fdc98e1bd39a2ea4bee9bcf58590c8;hp=b93eddaa9ac3d00d089d6b0dbb4987fcd6a83ee0;hpb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;p=lilypond.git diff --git a/scm/output-lib.scm b/scm/output-lib.scm index b93eddaa9a..53a5773d0f 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--2008 Jan Nieuwenhuizen +;;;; (c) 1998--2009 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys @@ -202,6 +202,8 @@ 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 @@ -250,6 +252,7 @@ centered, X==1 is at the right, X == -1 is at the left." ("" . ("" . "")) (":" . (":" . "")) ("." . ("." . ())) + ("'" . ("'" . ())) ("empty" . (() . ())) ("brace" . (() . "brace")) ("bracket" . (() . "bracket")) @@ -669,4 +672,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))))