X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdefine-markup-commands.scm;h=91b9391fe6600325df53b1c5c72df21f28e6f508;hb=8627d767e67258394cd4256740542a36dacd7868;hp=9ed4f9cc8301824433a9d39b7be0c59257c490cf;hpb=58dbefb1d96549bfa612629a67405edef13f2b9b;p=lilypond.git diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 9ed4f9cc83..91b9391fe6 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -2251,6 +2251,14 @@ Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}." `(delay-stencil-evaluation ,(delay expr)) x y)))) +(define-markup-command (with-outline layout props outline arg) + (markup? markup?) + #:category other + " +Print @var{arg} with the outline and dimensions of @var{outline}." + (ly:stencil-outline (interpret-markup layout props arg) + (interpret-markup layout props outline))) + (define-markup-command (with-dimensions-from layout props arg1 arg2) (markup? markup?) #:category other @@ -2333,10 +2341,7 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction. } } @end lilypond" - (let* ((m (interpret-markup layout props arg)) - (x (ly:stencil-extent m X)) - (y (ly:stencil-extent m Y))) - (ly:make-stencil (list 'transparent-stencil (ly:stencil-expr m)) x y))) + (ly:stencil-outline empty-stencil (interpret-markup layout props arg))) (define-markup-command (pad-to-box layout props x-ext y-ext arg) (number-pair? number-pair? markup?) @@ -3102,7 +3107,7 @@ normal text font, no matter what font was used earlier. #:category music "@var{glyph-name} is converted to a musical symbol; for example, @code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from -the music font. See @ruser{The Feta font} for a complete listing of +the music font. See @ruser{The Emmentaler font} for a complete listing of the possible glyphs. @lilypond[verbatim,quote] @@ -3701,17 +3706,18 @@ mensural-flags. Both are supplied for convenience. (raw-length (if stem-up upflag-length downflag-length)) (angle (if stem-up upflag-angle downflag-angle)) (flag-length (+ (* raw-length factor) half-stem-thickness)) - (flag-end (if (= angle 0) - (cons flag-length (* half-stem-thickness dir)) - (polar->rectangular flag-length angle))) + (flag-end (polar->rectangular flag-length angle)) (thickness (* flag-thickness factor)) (thickness-offset (cons 0 (* -1 thickness dir))) (spacing (* -1 flag-spacing factor dir)) (start (cons (- half-stem-thickness) (* half-stem-thickness dir))) - (points (list start - flag-end - (offset-add flag-end thickness-offset) - (offset-add start thickness-offset))) + (raw-points + (list + '(0 . 0) + flag-end + (offset-add flag-end thickness-offset) + thickness-offset)) + (points (map (lambda (coord) (offset-add coord start)) raw-points)) (stencil (ly:round-filled-polygon points half-stem-thickness)) ;; Log for 1/8 is 3, so we need to subtract 3 (flag-stencil (buildflags stencil (- log 3) stencil spacing))) @@ -3720,6 +3726,10 @@ mensural-flags. Both are supplied for convenience. (let* ((font (ly:paper-get-font layout (cons '((font-encoding . fetaMusic) (font-name . #f)) props))) + ;; default for text-font-size is 11 + ;; hence we use (/ text-font-size 11) later, to ensure proper scaling + ;; of stem-length and thickness + (text-font-size (ly:output-def-lookup layout 'text-font-size 11)) (size-factor (magstep font-size)) (blot (ly:output-def-lookup layout 'blot-diameter)) (head-glyph-name @@ -3743,8 +3753,9 @@ mensural-flags. Both are supplied for convenience. (attach-indices (ly:note-head::stem-attachment font head-glyph-name)) (stem-length (* size-factor (max 3 (- log 1)))) ;; With ancient-flags we want a tighter stem - (stem-thickness (* size-factor (if ancient-flags? 0.1 0.13))) - (stemy (* dir stem-length)) + (stem-thickness + (* size-factor (/ text-font-size 11) (if ancient-flags? 0.1 0.13))) + (stemy (* dir (/ text-font-size 11) stem-length)) (attach-off (cons (interval-index (ly:stencil-extent head-glyph X) (* (sign dir) (car attach-indices))) @@ -3812,7 +3823,6 @@ mensural-flags. Both are supplied for convenience. stem-thickness 0)) (+ stemy flag-style-Y-corr)))))) - ;; If there is a flag on an upstem and the stem is short, move the dots ;; to avoid the flag. 16th notes get a special case because their flags ;; hang lower than any other flags.