Skip to content

TextDecoration

TextDecoration #

Bases: IntFlag

A linear decoration to draw near the text.

LINE_THROUGH #

LINE_THROUGH = 4

Draw a line through each line of text.

NONE #

NONE = 0

Do not draw a decoration.

OVERLINE #

OVERLINE = 2

Draw a line above each line of text.

UNDERLINE #

UNDERLINE = 1

Draw a line underneath each line of text.

combine #

combine(
    decorations: list[TextDecoration],
) -> TextDecoration

Creates a decoration that paints the union of all the given decorations.

Usage Example#

The enum is a flag, so multiple decorations can be combined together as follows:

style = ft.TextStyle(decoration=ft.TextDecoration.UNDERLINE | ft.TextDecoration.OVERLINE)