neoscore.western.tab_string_text
- class neoscore.western.tab_string_text.TabStringText[source]
Bases:
MusicText
SMuFL text centered on a tab staff line.
This also automatically adds a background brush which hides the tab staff line behind the text.
- __init__(pos_x: Unit, staff: TabStaff, string: int, text: Union[MusicChar, str, Tuple[str, int], List[Union[MusicChar, str, Tuple[str, int]]]], font: Optional[MusicFont] = None, brush: Optional[Union[Brush, str]] = None, pen: Optional[Union[Pen, str]] = None, hide_background: bool = True, breakable: bool = True, alignment_x: AlignmentX = AlignmentX.CENTER, alignment_y: AlignmentY = AlignmentY.CENTER)[source]
- Parameters
pos_x – The x position relative to the parent. The text will be centered around this position.
staff – The parent staff
string – The 1-indexed string number this should appear on
text – The text to display. Can be given as a SMuFL glyph name, or other shorthand forms. See
MusicStringDef
.font – The font to use. Defaults to the staff’s font.
brush – The brush to fill in text shapes with.
pen – The pen to trace text outlines with. This defaults to no pen.
hide_background – Whether to paint over the background behind the text. Particularly useful for preventing overlaps with staff lines.
breakable – Whether this object should break across lines in Flowable containers.
alignment_x – The text’s horizontal alignment relative to
pos
. Note that the default value here is center-alignment, unlike most other text classes.alignment_y – The text’s vertical alignment relative to
pos
. Note that the default value here is center-alignment, unlike most other text classes.