load


Description:

public static Font load (string? family = null, int size = -1, int dpi = ( int) get_dpi (), FontWeight weight = REGULAR, FontSlant slant = REGULAR, FontWidth width = REGULAR, bool monospace = false, string? lang = null, string? script = null) throws Error

Loads the font that best matches the parameters.

Uses fontconfig for font matching.

Parameters:

family

the font family name or null

size

the preferred size in points or -1 for any size

dpi

the screen resolution or -1 to ignore dpi

weight

the font weight (e.g. bold) or -1 for any weight

slant

the font slant (e.g. italic) or -1 for any slant

width

the font width (e.g. narrow) or -1 for any width

monospace

set to true to prefer a monospace font

lang

a RFC-3066-style language code or null

script

an ISO 15924 script code or null

Returns:

the font or null if there was an error