Skip to content

TextDecoration

Inherits: IntFlag

A linear decoration to draw near the text.

Properties

  • LINE_THROUGH

    Draw a line through each line of text.

  • NONE

    Do not draw a decoration.

  • OVERLINE

    Draw a line above each line of text.

  • UNDERLINE

    Draw a line underneath each line of text.

Methods

  • combine

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

Properties#

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.

Methods#

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)