TextStyle
A style describing how to format and paint text.
Properties
- 
          baseline(TextBaseline | None) –The common baseline that should be aligned between this text span and its parent 
- 
          bgcolor(ColorValue | None) –Text background https://flet.dev/docs/reference/colors. 
- 
          color(ColorValue | None) –Text foreground https://flet.dev/docs/reference/colors. 
- 
          decoration(TextDecoration | None) –The decorations to paint near the text (e.g., an underline). 
- 
          decoration_color(ColorValue | None) –The color in which to paint the text decorations. 
- 
          decoration_style(TextDecorationStyle | None) –The style in which to paint the text decorations (e.g., dashed). 
- 
          decoration_thickness(Number | None) –The thickness of the decoration stroke as a multiplier of the thickness defined by 
- 
          font_family(str | None) –
- 
          foreground(Paint | None) –The paint drawn as a foreground for the text. 
- 
          height(Number | None) –The height of this text span, as a multiple of the font size. 
- 
          italic(bool) –Whether to use italic typeface. 
- 
          letter_spacing(Number | None) –The amount of space (in logical pixels) to add between each letter. A negative 
- 
          overflow(TextOverflow | None) –How visual text overflow should be handled. 
- 
          shadow(BoxShadowValue | None) –TBD 
- 
          size(Number | None) –The size of glyphs (in logical pixels) to use when painting the text. 
- 
          weight(FontWeight | None) –The typeface thickness to use when painting the text (e.g., bold). 
- 
          word_spacing(Number | None) –The amount of space (in logical pixels) to add at each sequence of white-space 
Methods
- 
            copy–
Properties#
class-attribute
      instance-attribute
  
#
baseline: TextBaseline | None = None
The common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box.
class-attribute
      instance-attribute
  
#
bgcolor: ColorValue | None = None
Text background https://flet.dev/docs/reference/colors.
class-attribute
      instance-attribute
  
#
color: ColorValue | None = None
Text foreground https://flet.dev/docs/reference/colors.
class-attribute
      instance-attribute
  
#
decoration: TextDecoration | None = None
The decorations to paint near the text (e.g., an underline).
class-attribute
      instance-attribute
  
#
decoration_color: ColorValue | None = None
The color in which to paint the text decorations.
class-attribute
      instance-attribute
  
#
decoration_style: TextDecorationStyle | None = None
The style in which to paint the text decorations (e.g., dashed).
Defaults to TextDecorationStyle.SOLID.
class-attribute
      instance-attribute
  
#
decoration_thickness: Number | None = None
The thickness of the decoration stroke as a multiplier of the thickness defined by the font.
class-attribute
      instance-attribute
  
#
foreground: Paint | None = None
The paint drawn as a foreground for the text.
class-attribute
      instance-attribute
  
#
height: Number | None = None
The height of this text span, as a multiple of the font size.
See detailed explanation here.
class-attribute
      instance-attribute
  
#
letter_spacing: Number | None = None
The amount of space (in logical pixels) to add between each letter. A negative value can be used to bring the letters closer.
class-attribute
      instance-attribute
  
#
overflow: TextOverflow | None = None
How visual text overflow should be handled.
class-attribute
      instance-attribute
  
#
size: Number | None = None
The size of glyphs (in logical pixels) to use when painting the text.
Defaults to 14.
class-attribute
      instance-attribute
  
#
weight: FontWeight | None = None
The typeface thickness to use when painting the text (e.g., bold).
Defaults to FontWeight.NORMAL.
class-attribute
      instance-attribute
  
#
word_spacing: Number | None = None
The amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word). A negative value can be used to bring the words closer.
Methods#
copy(
    *,
    size: Number | None = None,
    height: Number | None = None,
    weight: FontWeight | None = None,
    italic: bool | None = None,
    decoration: TextDecoration | None = None,
    decoration_color: ColorValue | None = None,
    decoration_thickness: Number | None = None,
    decoration_style: TextDecorationStyle | None = None,
    font_family: str | None = None,
    color: ColorValue | None = None,
    bgcolor: ColorValue | None = None,
    shadow: BoxShadowValue | None = None,
    foreground: Paint | None = None,
    letter_spacing: Number | None = None,
    word_spacing: Number | None = None,
    overflow: TextOverflow | None = None,
    baseline: TextBaseline | None = None,
)