2009/5/3 Kieren MacMillan <[email protected]>:
> There's likely a way to make a Scheme function which automatically
> \translate-s the text the correct amount, but I don't have time to
> investigate it.
Since the instrument name conveniently makes up the negative part of
the score markup's horizontal extent, the easiest workaround is to
remove it from the score's bounding box.
The following markup command performs a selective \with-dimensions on
a markup without having to work out the extent of the instrument name:
#(define-markup-command (ignoreInstrumentName layout props score) (markup?)
(let* (
;; get stencil from markup
(stencil (interpret-markup layout props score))
;; get dimensions of stencil in X and Y axes
(x-extent (ly:stencil-extent stencil X))
(y-extent (ly:stencil-extent stencil Y)))
;; reset left part of x-extent so it's the same as
;; a score markup without an instrument name
(set-car! x-extent -0.2)
;; return a copy of original stencil with altered bounding box
(ly:make-stencil (ly:stencil-expr stencil) x-extent y-extent)))
\markup {
\fill-line {
\ignoreInstrumentName
\score {
\new Staff \with { instrumentName = "Instrument Name" } { a4 g a f }
\layout { indent = 0 }
}
}
}
\markup {
\fill-line {
\score {
\new Staff { a4 g a f }
\layout { indent = 0 }
}
}
}
Regards,
Neil
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user