[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: override ?
From: |
Thomas Morley |
Subject: |
Re: override ? |
Date: |
Mon, 23 Dec 2019 23:03:10 +0100 |
Am Mo., 23. Dez. 2019 um 21:40 Uhr schrieb Freeman Gilmore
<address@hidden>:
>
> Would someone explain what line 5 does and what "::"means? Why line 6 is
> not enough.
>
> 1 \version "2.19.10"
> 2 sesquisharp = \markup { \sesquisharp }
> 3
> 4 \relative {
> 5 \once \override Accidental.stencil = #ly:text-interface::print
> 6 \once \override Accidental.text = #sesquisharp
> 7 cis''4 }
>
> Thank you, ƒg
The default stencil-procedure to print Accidental is
`ly:accidental-interface::print`. It does _not_ read the text-property
Line 5 changes the procedure to `ly:text-interface::print`, which does
read said text-property.
Thus you need both if you want to go this route.
Although, this method is documented, it's implementation is a lil bit so-so.
If you complie with the option `-dcheck-internal-types` you'll get:
programming error: Grob `Accidental' has no interface for property `text'
continuing, cross fingers
The "::" is more a convention, you'll find a plethora of namings
containing them, mostly call-backs.
You could change it:
\version "2.19.10"
sesquisharp = \markup { \sesquisharp }
#(define text-interface-print ly:text-interface::print)
\relative {
\once \override Accidental.stencil = #text-interface-print
\once \override Accidental.text = #sesquisharp
cis''4 }
Cheers,
Harm