\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" }