FontDialog
classin packageklyn.gui.windows.dialogs
public class FontDialog extends Dialog:
└ Widget
└ Dialog
└ FontDialog

Themed dialog that selects a font installed on the operating system.

Every visible family row is painted with that family, while the preview pane reflects the selected size, bold state and italic state. Use FontLightBox when the chooser must remain embedded in an existing application window.

dialog = FontDialog(Font("DejaVu Sans", 16))
if dialog.showDialog(window):
label.font = dialog.selectedFont
Inherited Attributes
attributeInherited Attributes from Dialog: terminal, title
attributeInherited Attributes from Widget: lastRenderAnsi, lastRenderHeight, lastRenderPlain, lastRenderWidth, layout, visible
Properties
Modifier and Type Member Description
public property previewText
previewText as String:
Text rendered in the large preview area.
public readonly property selectedFont
selectedFont as Font:
Font accepted by the user, or the initial font after cancellation.
Inherited Properties
propertyInherited Properties from Widget: focusable, focused, lastRenderFrame, position, size
propertyInherited Properties from Object: type
Inherited Events
eventInherited Events from Dialog: accepted, cancelled
Constructors
Modifier and Type Member Description
public FontDialog
FontDialog(selectedFont as Font = null, title as String = "Select font"):
Creates a font-selection dialog.
Methods
Modifier and Type Member Description
public showDialog
showDialog(owner as Window = null) as Boolean:
Displays the dialog and blocks until the user accepts or cancels it.
Inherited Methods
methodInherited Methods from Dialog: accept, cancel, close, show
methodInherited Methods from Widget: add, baseAnsiStyle, captureRenderFrame, children, clearChildren, configureCursor, focusNext, handleEvent, handleMouseEvent, hasActiveTextInput, idle, paint, paintToFrame, performLayout, refresh, renderAnsiSnapshot, renderPlainSnapshot, scrollbarThumbGlyph, scrollbarTrackGlyph, terminalPromptVisible
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toString, toXml