Skip to main content

load_font

fun load_font(_ paths: [String]) -> (FontFamilyName)

Parameters

_ paths: [String]

A list of font file paths relative to the main file.

The font files should be of the same family.

Returns

FontFamilyName

The loaded font family, for use as a component's font_family.

Example

import { Text, load_font } from ui

var my_font = load_font([
"assets/Roboto-Regular.ttf",
"assets/Roboto-Bold.ttf",
"assets/Roboto-Italic.ttf",
])

export var main = Text("Hello, world!", font_family: my_font)