From: David Kastrup Date: Sun, 3 Mar 2013 00:04:31 +0000 (+0100) Subject: Issue 3187: Ugly alignment of text and score within a markup X-Git-Tag: release/2.17.14-1~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=692b4e4ed7c1aae4d4d53ad59c26c22f2dd2d90f;p=lilypond.git Issue 3187: Ugly alignment of text and score within a markup For \score within \markup, the reference point (usually the middle staff line) of the lowest staff in the top system is placed on the baseline. This is an incompatible change, but the previous behavior (placing the _highest_ y coordinate of the score on the baseline, disregarding the staves) was not useful. --- diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 92b4b704eb..d3ad150ff6 100755 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -968,7 +968,9 @@ samplePath = " @cindex inserting music into text -Inline an image of music. +Inline an image of music. The reference point (usually the middle +staff line) of the lowest staff in the top system is placed on the +baseline. @lilypond[verbatim,quote] \\markup { @@ -1014,10 +1016,18 @@ Inline an image of music. (let ((output (ly:score-embedded-format score layout))) (if (ly:music-output? output) - (stack-stencils Y DOWN baseline-skip - (map paper-system-stencil - (vector->list - (ly:paper-score-paper-systems output)))) + (let ((paper-systems + (vector->list + (ly:paper-score-paper-systems output)))) + (if (pair? paper-systems) + ;; shift such that the refpoint of the bottom staff of + ;; the first system is the baseline of the score + (ly:stencil-translate-axis + (stack-stencils Y DOWN baseline-skip + (map paper-system-stencil paper-systems)) + (- (car (paper-system-staff-extents (car paper-systems)))) + Y) + empty-stencil)) (begin (ly:warning (_"no systems found in \\score markup, does it have a \\layout block?")) empty-stencil))))