3.2.67 item-interface

Grobs can be distinguished in their role in the horizontal spacing. Many grobs define constraints on the spacing by their sizes, for example, note heads, clefs, stems, and all other symbols with a fixed shape. These grobs form a subtype called Item.

Some items need special treatment for line breaking. For example, a clef is normally only printed at the start of a line (i.e., after a line break). To model this, ‘breakable’ items (clef, key signature, bar lines, etc.) are copied twice. Then we have three versions of each breakable item: one version if there is no line break, one version that is printed before the line break (at the end of a system), and one version that is printed after the line break.

Whether these versions are visible and take up space is determined by the outcome of the break-visibility grob property, which is a function taking a direction (-1, 0 or 1) as an argument. It returns a cons of booleans, signifying whether this grob should be transparent and have no extent.

The following variables for break-visibility are predefined:

           grob will show:   before  no     after
                             break   break  break
  all-invisible              no      no     no
  begin-of-line-visible      no      no     yes
  end-of-line-visible        yes     no     no
  all-visible                yes     yes    yes
  begin-of-line-invisible    yes     yes    no
  end-of-line-invisible      no      yes    yes
  center-invisible           yes      no    yes

User settable properties:

break-visibility (vector)

A vector of 3 booleans, #(end-of-line unbroken begin-of-line). #t means visible, #f means killed.

extra-spacing-height (pair of numbers)

In the horizontal spacing problem, we increase the height of each item by this amount (by adding the ‘car’ to the bottom of the item and adding the ‘cdr’ to the top of the item). In order to make a grob infinitely high (to prevent the horizontal spacing problem from placing any other grobs above or below this grob), set this to (-inf.0 . +inf.0).

extra-spacing-width (pair of numbers)

In the horizontal spacing problem, we pad each item by this amount (by adding the ‘car’ on the left side of the item and adding the ‘cdr’ on the right side of the item). In order to make a grob take up no horizontal space at all, set this to (+inf.0 . -inf.0).

non-musical (boolean)

True if the grob belongs to a NonMusicalPaperColumn.

This grob interface is used in the following graphical object(s): Accidental, AccidentalCautionary, AccidentalPlacement, AccidentalSuggestion, Ambitus, AmbitusAccidental, AmbitusLine, AmbitusNoteHead, Arpeggio, BarLine, BarNumber, BassFigure, BassFigureBracket, BreakAlignGroup, BreakAlignment, BreathingSign, CaesuraScript, ChordName, Clef, ClefModifier, ClusterSpannerBeacon, CodaMark, CombineTextScript, CueClef, CueEndClef, Custos, Divisio, DotColumn, Dots, DoublePercentRepeat, DoublePercentRepeatCounter, DoubleRepeatSlash, DynamicText, Fingering, FingeringColumn, Flag, FretBoard, GridLine, GridPoint, InstrumentSwitch, JumpScript, KeyCancellation, KeySignature, LaissezVibrerTie, LaissezVibrerTieColumn, LeftEdge, LyricRepeatCount, LyricText, MelodyItem, MetronomeMark, NonMusicalPaperColumn, NoteCollision, NoteColumn, NoteHead, NoteName, NoteSpacing, PaperColumn, RehearsalMark, RepeatSlash, RepeatTie, RepeatTieColumn, Rest, RestCollision, Script, ScriptColumn, ScriptRow, SectionLabel, SegnoMark, SignumRepetitionis, SostenutoPedal, SpanBar, SpanBarStub, StaffEllipsis, StaffSpacing, StanzaNumber, Stem, StemStub, StemTremolo, StringNumber, StrokeFinger, SustainPedal, TabNoteHead, TextMark, TextScript, TimeSignature, TrillPitchAccidental, TrillPitchGroup, TrillPitchHead, TrillPitchParentheses and UnaCordaPedal.

In addition, this interface is supported conditionally by the following objects depending on their class: BalloonText, ControlPoint, ControlPolygon, Footnote and Parentheses.


LilyPond – Internals Reference v2.24.4 (stable-branch).