| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There are a few classes of difficult adjustments.
\overrides.
In other words, an \override always affects all pieces of a
broken spanner. To change only one part of a spanner at a line break,
it is necessary to hook into the formatting process. The
after-line-breaking callback contains the Scheme procedure that
is called after the line breaks have been determined and layout
objects have been split over different systems.
In the following example, we define a procedure
my-callback. This procedure
extra-offset.
This procedure is installed into (internals)Tie section ‘Tie’ in Internals Reference, so the last part of the broken tie is repositioned.
#(define (my-callback grob) (let* ( ;; have we been split? (orig (ly:grob-original grob)) ;; if yes, get the split pieces (our siblings) (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '()))) (if (and (>= (length siblings) 2) (eq? (car (last-pair siblings)) grob)) (ly:grob-set-property! grob 'extra-offset '(1 . -4))))) \relative { \override Tie.after-line-breaking = #my-callback c''1 ~ \break c2 ~ 2 }
When applying this trick, the new after-line-breaking callback
should also call the old one, if such a default exists. For example,
if using this with Hairpin, ly:spanner::kill-zero-spanned-time
should also be called.
\override for
technical reasons. Examples of those are NonMusicalPaperColumn
and PaperColumn. They can be changed with the
\overrideProperty function, which works similar to \once
\override, but uses a different syntax.
\overrideProperty Score.NonMusicalPaperColumn % Grob name . line-break-system-details % Property name . next-padding % Optional subproperty name #20 % Value |
Note, however, that \override, applied to
NonMusicalPaperColumn and PaperColumn, still works as
expected within \context blocks.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by gub on July 13, 2020 using texi2html 1.82.
Más nyelvek: deutsch, español, français.
Az automatikus nyelvválasztásról.