ProteinMotion
Reference navigation
On this page

TextStyle

Reusable typography for Text(style=...). Sizes use 1080p design pixels.

python
from proteinmotion import TextStyle

Constructor

python
TextStyle(
    font_size: float=36,
    font: str='regular',
    color: str | tuple='#edf3fc',
    line_spacing: float=1.3,
)

Parameters

ParameterDefaultDescription
font_sizefloat36Font size in pixels at a 1080-pixel image height.
fontstr'regular'Bundled "regular" or "semibold", or a path to a TTF/OTF font.
colorstr | tuple'#edf3fc'Hex color or RGB values. For tint setters, None restores the representation’s base palette.
line_spacingfloat1.3Line spacing multiplier.

Attributes

NameDescription
font_sizeFont size in pixels at a 1080-pixel image height.
fontBundled "regular" or "semibold", or a path to a TTF/OTF font.
colorHex color or RGB values. For tint setters, None restores the representation’s base palette.
line_spacingLine spacing multiplier.