Skip to content

Search

Wstecz
· 1 min czytania

Text decorations

text2d, text3d and widget labels take underlines, strikethroughs, overlines, oblique faces, OpenType features, justified lines and a cut with an ellipsis.

text2d, text3d and widget labels take the decorations and shaping settings cosmic-text has.

A widget label underlined with an outline, a double underline with a strikethrough and an overline, oblique small caps, a justified block and a line cut in the middle

  • underline is single or double. strikethrough and overline draw a line through or over the glyphs, and each takes a colour of its own.
  • font_style is normal, italic or oblique, the upright face slanted. font_stretch picks among the widths a family ships.
  • font_features turns OpenType features on and off: smcp draws small caps, and liga=0 stops ligatures.
  • text_align adds left, right and justify, which stretches every full line.
  • truncate ends a cut block with an ellipsis at max_lines or max_height, and truncate_at puts it at the end, start or middle.
  • line_break, hinting, tab_width and shaping set how lines wrap, how outlines snap, where tabs stop and whether complex scripts join.
[nodes.text2d]
text = "Underlined, struck and overlined"
underline = "double"
underline_color = [1.0, 0.3, 0.3, 1.0]
strikethrough = true
overline = true