bootstack.dialogs.FontDialog#
- class bootstack.dialogs.FontDialog(*, title='', default_font='body', parent=None)#
Bases:
objectA dialog for selecting a font family, size, weight, slant, and effects.
The dialog shows a scrollable list of font families, a size list, and controls for weight (normal/bold), slant (roman/italic), underline, and overstrike. A live preview panel shows sample text rendered in the selected font.
- Parameters:
title (str) – Dialog window title. Defaults to the localized “Font” string.
default_font (str) – Font token to show initially (e.g.
'body','code','heading-lg'). Defaults to'body'. See Typography.parent (Any) – Parent widget. Defaults to the active root window.
- property result: FontChoice | None#
The selected font, or
Noneif canceled.Returns a
FontChoicenamedtuple with six attributes:family— font family name (str).size— point size (int).weight—'normal'or'bold'.slant—'roman'or'italic'.underline—Trueif underlined.overstrike—Trueif struck through.
- show(*, position=None, modal=None)#
Display the dialog and block until it is closed.
- Parameters:
- Returns:
self— allows chaining –dlg = FontDialog(...).show(); dlg.result.- Return type: