Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ITypefaceRegistry

interface ITypefaceRegistry
Extends com.amazon.apmf.IStandard This interface provides a centralized registry for typefaces, allowing typefaces to be registered and unregistered by a unique identifier. Registered typefaces are identified by a unique id and associated with a resource path. These methods must be called on the UI thread. The registry is not internally synchronized and is read on the UI thread by concurrent text rendering, so a call from any other thread is not supported; callers on another thread must marshal the call onto the UI thread.

Methods

registerTypeface()

void registerTypeface(string id, string resource)
Registers a typeface with the specified identifier in the registry. If a typeface is already registered with the given identifier, the existing registration is replaced with the new resource. The client is responsible for ensuring that the specified resource path is accessible by the platform.

Parameters

id
string — Required A unique identifier for the typeface. Generally, the font file name (without extension) is used as the identifier (e.g., “Roboto”, “OpenSans”), matching the value used in React Native’s fontFamily style property.
resource
string — Required The absolute filesystem path of the typeface font file to register. A leading file:// URI scheme prefix is accepted and will be stripped before the file is loaded; other URI schemes (e.g., http://, asset://) are not supported.

Throws

  • InvalidArgumentError — If id or resource is empty, or if there is an issue accessing the specified font file (e.g., file not found, insufficient permissions, or invalid path).

unregisterTypeface()

void unregisterTypeface(string id)
Unregisters a previously registered typeface by its identifier. After unregistration, the typeface is no longer available in the registry.

Parameters

id
string — Required The unique identifier of the typeface to unregister.

Throws


Last modified on October 29, 2026