loadFontImageMap

fun loadFontImageMap(fileOrUrl: String, size: Double, characterSet: Set<Char> = defaultFontmapCharacterSet, contentScale: Double = 1.0, fontScaler: (Face) -> Double = ::fontHeightScaler): FontImageMap(source)

Loads a font image map from a given file or URL. This function creates a FontImageMap instance from the specified font resource, applying the given properties such as size, character set, content scale, and a font scaling method.

Return

A FontImageMap that represents the pre-rendered character textures for the specified font. Throws an exception if the file does not exist, is not a .ttf or .otf file, or if the URL is invalid.

Parameters

fileOrUrl

The path to a local font file or a URL pointing to a font resource.

size

The desired size of the font to be loaded.

characterSet

A set of characters to include in the font image map. Defaults to defaultFontmapCharacterSet. If a space character is not explicitly included, it will be added automatically.

contentScale

A scaling factor for adjusting the pixel density of the font image map. Defaults to 1.0.

fontScaler

A function defining how the font is scaled within the image map. Defaults to ::fontHeightScaler.