registerFont

fun registerFont(name: String, fontHandle: FontHandle)

Register a font as an asset with the given name. This allows the font to be used to fulfill a referenced asset when loading a Rive file.

The CommandServer will keep a reference to the font. For it to be fully released, you must unregister it with unregisterFont.

Registrations are global to the CommandQueue, meaning that the name will be used to fulfill any file loaded by this CommandQueue that references the asset with the same name.

The same font can be registered multiple times with different names, allowing it to fulfill multiple referenced assets in all Rive files on this CommandQueue.

Parameters

name

The name of the referenced asset to fulfill. Must match the name in the zip file when exporting from Rive.

fontHandle

The handle of the font to register.

Throws

If the CommandQueue has been released.