[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help a newb: Formatting custom instrument names
From: |
Leo Correia de Verdier |
Subject: |
Re: Help a newb: Formatting custom instrument names |
Date: |
Mon, 7 Dec 2020 23:36:22 +0100 |
I’m not sure if this is an interesting suggestion, but if you want this as the
actual clef you could write
%%%%%%%%%%%%%%
\once \override Staff.Clef.stencil = #ly:text-interface::print
\once \override Staff.Clef.text = \markup {
\override #'(font-size . -6.5)
\unit-height-column { First second third fourth fifth sixth seventh eighth
ninth tenth eleventh } }
\once \override Staff.Clef.Y-offset = #5
\clef treble % or whatever
%%%%%%%%%%%%%%
> 7 dec. 2020 kl. 22:39 skrev Lukas-Fabian Moser <lfm@gmx.de>:
>
> Hi Michael,
>
>> Maybe something like this?
>>
>> \version "2.21.80"
>>
>> \layout {
>> indent = 5
>> }
>>
>> #(define-markup-command (unit-height layout props arg) (markup?)
>> (let* ((stil (interpret-markup layout props arg))
>> (x (ly:stencil-extent stil 0)))
>> (interpret-markup layout props
>> (make-with-dimensions-markup x '(-0.5 . 0.5) (markup
>> #:general-align 1 0 arg)))))
>
> Of course that's insane, because the same markup is interpreted twice, and
> because 0.5 isn't an exact number. Hopefully better version:
>
> \version "2.21.80"
>
> \layout {
> indent = 5
> }
>
> #(define-markup-command (force-unit-height layout props arg) (markup?)
> (let* ((y-centered-arg (markup #:general-align 1 0 arg))
> (stil (interpret-markup layout props y-centered-arg))
> (x (ly:stencil-extent stil 0))
> (y (cons -1/2 1/2)))
> (ly:stencil-outline stil (make-filled-box-stencil x y))))
>
> #(define-markup-command (unit-height-column layout props args) (markup-list?)
> (interpret-markup layout props #{
> \markup {
> \override #'(baseline-skip . 0)
> \center-column \force-unit-height #args
> } #} ))
>
> \new Staff \with {
> \override StaffSymbol.line-count = 12
> instrumentName = \markup {
> \override #'(font-size . -10)
> \unit-height-column { First second third fourth fifth sixth seventh
> eighth ninth tenth eleventh }
> }
> }
> { a'4 }
>
> Lukas
>