loadFreeTypeFontSync

inline fun AssetStorage.loadFreeTypeFontSync(path: String, setup: FreeTypeFontGenerator.FreeTypeFontParameter.() -> Unit = {}): BitmapFont

Loads a FreeType font synchronously. Blocks the current thread until the font is loaded. Allows customizing parameters of a loaded FreeType font.

This method is safe to call from the main rendering thread, as well as other application threads. However, make sure that the same font is not loaded asynchronously by other thread with the same AssetStorage. See AssetStorage.loadSync for details.

path is the file path to the FreeType font file. Must be compatible with the AssetStorage.fileResolver.

setup can be used to specify and customize the parameters of the loaded font. It will be inlined and invoked on a FreeTypeFontParameter.

Returns the result of font loading. See AssetStorage.loadSync for lists of possible outcomes.

See also loadFreeTypeFont and loadFreeTypeFontAsync.