Class TextStyle
Holds information about the style of text.
Declaration
class TextStyle
source linkDocumentation
Methods
▶ def __init__(self, *, font=None, size=None, align=None, line_spacing=None, color=None, ...) def __init__(
self,
*,
font=None,
size=None,
align=None,
line_spacing=None,
color=None,
bold=None,
italic=None,
variant_numeric=None,
)
Parameters
- font : str
Font used to render the text.
- size : float
Size of the font.
- align : {"center", "left", "right"}
Alignment of the text.
- line_spacing : float
Space between lines. Scales with font size.
- color : str
Color of the text.
- bold : bool
If True, the text will be rendered as bold.
- italic : bool
If True, the text will be rendered as italic.
- variant_numeric : str
SVG mode for rendering of digits (e.g. "lining-nums").
▷ def align(self) @property ▷ def align(self, value) @align.setter @align.setter
def align(
self,
value,
)
▷ def bold(self) @property ▷ def bold(self, value) @bold.setter @bold.setter
def bold(
self,
value,
)
▷ def color(self) @property ▷ def color(self, value) @color.setter @color.setter
def color(
self,
value,
)
▷ def compose(self, style: TextStyle) -> TextStyle Create a new style that will be the combination of the current and the given style.
▷ def copy(self) -> TextStyle Copies the text style.
▷ def font(self) @property ▷ def font(self, value) @font.setter @font.setter
def font(
self,
value,
)
@property
def italic(self)
▷ def italic(self, value) @italic.setter @italic.setter
def italic(
self,
value,
)
@property
def line_spacing(self)
@line_spacing.setter
def line_spacing(
self,
value,
)
▷ def size(self) @property ▷ def size(self, value) @size.setter @size.setter
def size(
self,
value,
)
▷ def update(self, style: TextStyle) Updates the text style in-place.
@property
def variant_numeric(self)
@variant_numeric.setter
def variant_numeric(
self,
value,
)
Reexports