Text
Draws value with style at the given (x, y) point.
Inherits: canvas.Shape
Properties
alignment- A point within a text rectangle to determine its position and rotation center.ellipsis- String used to ellipsize overflowing text.max_lines- The maximum number of lines painted.max_width- The maximum width of the painted text.rotate- The rotation of this text in radians.spans- The list of TextSpan objects to build a rich text paragraph.style- A text style to drawtextandspanswith.text_align- Text horizontal align.value- The text to draw.x- The x-axis coordinate of the text'salignmentpoint.y- The y-axis coordinate of the text'salignmentpoint.
Properties
alignmentclass-attributeinstance-attribute
alignment: Alignment = field(default_factory=(lambda: Alignment.TOP_LEFT))A point within a text rectangle to determine its position and rotation center.
ellipsisclass-attributeinstance-attribute
ellipsis: Optional[str] = NoneString used to ellipsize overflowing text.
max_linesclass-attributeinstance-attribute
max_lines: Optional[int] = NoneThe maximum number of lines painted. Lines beyond this number are silently dropped. For example, if max_lines = 1, then only one line is rendered.
If max_lines = None, but ellipsis != None, then lines after the first one
that overflows the width constraints are dropped.
max_widthclass-attributeinstance-attribute
max_width: Optional[Number] = NoneThe maximum width of the painted text.
Defaults to None - infinity.
rotateclass-attributeinstance-attribute
rotate: Number = 0The rotation of this text in radians. Text is rotated around the point determined by alignment.
spansclass-attributeinstance-attribute
spans: Optional[list[TextSpan]] = NoneThe list of TextSpan objects to build a rich text paragraph.
styleclass-attributeinstance-attribute
style: Optional[TextStyle] = NoneA text style to draw text and spans with.
text_alignclass-attributeinstance-attribute
text_align: TextAlign = TextAlign.STARTText horizontal align.