While following this thread I've copied the various solutions into a growing file. Interstingly with all three proposed solution one after another the final resulting PDF is roted by 90 degree as well.
Commenting out any of the 4 \markup (or note) lines does not rotate the PDF, but with all it does. Why is that so ? Find attached the ly and pdf. Kind regards, Michael -- Michael Gerdau email: [email protected] GPG-keys available on request or at public keyserver
\version "2.19.27"
verticalText #(define-event-function (text) (markup?)
#{
-\tweak TextScript.self-alignment-X #LEFT
-\markup \rotate #90 #text
#})
{
c'2^\verticalText \markup \italic "This is a long markup" c
c'2\verticalText "This is a long text" c
}
%%% modified from define-markup-commands.scm, line 701ff.
#(define-markup-command (rotate-by-anchor layout props angle anchor arg)
(number? pair? markup?)
#:category align
"
@cindex rotating text
Rotate object with @var{angle} degrees around @var{anchor}.
@lilypond[verbatim,quote]
\\markup {
default
\\hspace #2
\\rotate #45 #'(-1 . 0)
\\line {
rotated 45°
}
}
@end lilypond"
(let* ((stil (interpret-markup layout props arg)))
(ly:stencil-rotate stil angle (car anchor) (cdr anchor))))
{
c'2 ^\markup \rotate-by-anchor #90 #'(-1 . 0) "This is a long markup" c
}
#(define-markup-command (my-rotate layout props ang arg)
(number? markup?)
(let* ((stil (interpret-markup layout props arg))
(stil-x-length (interval-length (ly:stencil-extent stil X)))
(stil-y-length (interval-length (ly:stencil-extent stil Y))))
(ly:stencil-rotate stil ang (/ stil-y-length -2) (/ stil-x-length -2))))
\markup {
"ab"
\my-rotate #90 "------|------"
"xy"
}
rotate-test.pdf
Description: Adobe PDF document
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
