[ enum ] FontFamily

Description:

An enum for generic font family names to use instead of a font name that may not be installed on target operating systems.
Use with component.font(), Text() shape, font property of a List item, Tree item, ComboBox item, Table column, and everywhere else where font can be set.

Type: string

Properties:

Name Description

Serif

Proportional font with small decorative strokes at the ends of letters (e.g., Times New Roman, Georgia, Garamond, Cambria.).

SansSerif

Proportional font without decorative strokes; clean and modern (e.g., Arial, Helvetica, Verdana, Calibri, Open Sans).

Monospaced

Fixed-width font where every character has the same width (e.g., Courier New, Consolas, Lucida Console, Menlo).

Cursive

Flowing, handwritten-style font (e.g., Brush Script, Comic Sans MS, Pacifico, Lobster).

System

The system UI font provided by the operating system. (e.g., Segoe UI (Windows), San Francisco (macOS/iOS), Roboto (Android/Linux)).

Fantasy

Decorative or themed font (e.g., Impact, Papyrus, Jokerman, Copperplate).

Examples:

Setting component font:

textarea.font({name: FontFamily.SansSerif});

Setting Text shape font:

let text = new Text("Hello World", {name: FontFamily.Fantasy, size: 30});

Also See: