Controlling the vertical ordering of scripts: Difference between revisions

Import snippet from LSR
 
Synchronize with a 'new' snippet in the LilyPond git archive
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The vertical ordering of scripts is controlled with the <code>'script-priority</code> property. The lower this number, the closer it will be put to the note. In this example, the <code>TextScript</code> (the ''sharp'' symbol) first has the lowest priority, so it is put lowest in the first example. In the second, the ''prall trill'' (the <code>Script</code>) has the lowest, so it is on the inside. When two objects have the same priority, the order in which they are entered determines which one comes first.
The vertical ordering of scripts is controlled with the <code>script-priority</code> property. The lower this number, the closer it will be put to the note. In this example, the <code>TextScript</code> (the ''sharp'' symbol) first has the lowest priority, so it is put lowest in the first example. In the second, the ''prall trill'' (the <code>Script</code>) has the lowest, so it is on the inside. When two objects have the same priority, the order in which they are entered determines which one comes first.


<lilypond version="2.24.0">
Note that for <code>Fingering</code>, <code>StringNumber</code>, and <code>StrokeFinger</code> grobs, if used within a chord, the vertical order is also determined by the vertical position of the associated note head, which is added to (or, depending on the direction, subtracted from) the grob’s <code>script-priority</code> value. This ensures that for fingerings above a chord the lower note is associated with the lower fingering (and vice versa for the other direction); it doesn’t matter whether you input the notes in the chord from top to bottom or from bottom to top.
 
By default, the least technical scripts are positioned closest to the note head; the rough order is articulation, flageolet, fingering, right-hand fingering, string number, fermata, bowing, and text script.
 
<lilypond version="2.24">
\relative c''' {
\relative c''' {
   \once \override TextScript.script-priority = -100
   \once \override TextScript.script-priority = -100
Line 8: Line 12:
   \once \override Script.script-priority = -100
   \once \override Script.script-priority = -100
   a2^\prall^\markup { \sharp }
   a2^\prall^\markup { \sharp }
  \set fingeringOrientations = #'(up)
  <c-2 a-1>2
  <a-1 c\tweak script-priority -100 -2>2
}
}
</lilypond>
</lilypond>


[[Category:Expressive marks]]
[[Category:Expressive marks]]
[[Category:Expressive marks]]
[[Category:Tweaks and overrides]]
[[Category:Tweaks and overrides]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]