Simp module

get_font_at_size

procedure2 overloadsSource

Loads a font file at a size, reusing the font if it was loaded at that size before. Returns null if the file can't be read.

Sizes are in drawing units. With pixel_scale above 1 (a Retina window) the glyphs are made at pixel_height * pixel_scale device pixels and drawn at 1/pixel_scale, so text stays sharp.

get_font_at_size :: (
    path: string,
    name: string,
    pixel_height: int,
    pixel_scale := 1.0
) -> *Dynamic_Font

Parameters

path: string
name: string
pixel_height: int
pixel_scale := 1.0

Returns

get_font_at_size :: (
    memory: [] u8,
    pixel_height: int,
    pixel_scale := 1.0
) -> *Dynamic_Font

Loads a font from the bytes of a font file at a size. Returns null if they aren't a usable font.

Parameters

memory: [] u8
pixel_height: int
pixel_scale := 1.0

Returns

See also