Loads a font file at one size. Returns null when the file cannot be read.
- path: the folder the font file is in. Empty means
basenameis the whole path. - basename: the font file, for instance a
.ttf. - pixel_height: how tall the text is in pixels.
- pixel_scale: device pixels per pixel, for sharp text on a high-density display. Glyphs are made at
pixel_height * pixel_scaleand measured back inpixel_heightunits.
load_font :: (
path: string,
basename: string,
pixel_height: int,
pixel_scale := 1.0
) -> font: *Dynamic_Font
Loads a font file at one size. Returns null when the file cannot be read.
Parameters
- path: string
- the folder the font file is in. Empty means
basenameis the whole path. - basename: string
- the font file, for instance a
.ttf. - pixel_height: int
- how tall the text is in pixels.
- pixel_scale := 1.0
- device pixels per pixel, for sharp text on a high-density display. Glyphs are made at
pixel_height * pixel_scaleand measured back inpixel_heightunits.
Returns
- font: *Dynamic_Font