API Reference › Font › Font.load
method

Font.load

Font.load(path: p) -> int

Loads a TrueType font file and returns its handle. Load it before Ui.build so the menus can measure their text; the handle is what a ui block's font: reads.

Example

# doc-check: skip — illustrative
var menu_font: int = 0
handler Boot phase Start {
  menu_font = Font.load(path: "assets/fonts/PixelOperator.ttf")
  Ui.build()
}
← All symbols