Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
It is possible to add an object that will be included in the callback to avoid creating too many closures.
Calling twice addEventListener with the same parameters results in the second call to be ignored,
only unique pairs callback / object are allowed, in order to avoid calling multiple times the same
thing.
The id of the inserted callback (actually an UUID).
Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
The id of the inserted callback (actually an UUID).
Gets the concatenation of all fonts error.
Fonts are loaded by a call to loadFont.
The error messages of the fonts in error.
Gets the number of fonts in error.
Fonts are loaded by a call to loadFont.
The number of fonts in error.
Gets the number of loading fonts.
Fonts are loaded by a call to loadFont.
The number of loading fonts.
Gets all the registered fonts.
Fonts are registered by a call to registerFont.
Gets the number of registered fonts.
Fonts are registered by a call to registerFont.
The number of registered fonts.
Tells if the EventDispatcher has such a callback registered for the given event type.
true if such a listener is installed for the given type of event.
Tells if the given font is loaded.
Returns true if the given font is loaded.
true if the font is loaded.
Asks the font loader to begin loading the given font.
Returns a FontLoadingStatus that tells the result of the load request.
The FontLoadingStatus that tells the result of the load request.
Registers a font to the font loading mechanism.
As fonts are loaded only when needed, the family name, bold and italic properties must be set beforehand in order to tell the system to load such a font when an annotation needs it.
If a font with the same properties was already registered, the call to registerFont may only change the default font if set. It will return true even if the font url or data is not changed.
If pUrlOrContent is a string, next calls to loadFont will be asynchronous, if pUrlOrContent is an ArrayBuffer, then next calls to loadFont will be synchronous (and the FontLoaderInterfaceSignal.FontsLoaded signal is sent right away).
Optional pDefaultFont: booleantrue if the input parameters are correct. If such a font is already registered, true is also returned.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
true if the callback was removed else false.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
true if the callback was removed else false.
Removes a listener by its id.
If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.
true if the callback was removed else false.
Sets an already registered font to be the default one.
Returns true if such a font was found and set as default.
true if such a font was found and set as default. If such a font was already the default font,
then true is also returned.
Un-registers a font from the font loading mechanism.
You cannot unregister the default font nor the 3djuump Infinite default font.
Returns true if such a font was found and unregistered.
true if such a font was found and unregistered.
The FontLoaderInterface is used when displaying annotations.
The underlying optimized rendering algorithms of annotations must have access to glyph data and metrics, but these information are not accessible through the native javascript api. For these reasons, the api must be able to parse font files and retrieve such data.
There may be some specific fonts needed to display your annotations. Just register them to the system with registerFont. You may register fonts from their url, or from their data with an ArrayBuffer. Font loading takes place when annotations are parsed and included in the AnnotationRendererInterface. Even if loadFont is provided, the font loading mechanism will automatically take place when required.
The api provides a fixed size default font (included in its script, nothing needs to be done to get this default font), that supports usual special characters of annotations, the 3djuump Infinite default font.
If a font is not found in the FontLoaderInterface, then the default font is used. And if the default font could not be loaded, then the 3djuump Infinite default font is used. You may override the default font when registering fonts. There can be only one default font. The default font is changed through calling registerFont or setDefaultFont accordingly. If such a font is not valid, then the api will use the 3djuump Infinite default font.
Family names in the FontLoaderInterface are case insensitive, all family names will be used lowercase.
For memory reasons, there is only one FontLoaderInterface, and thus FontLoaderInterface(s) cannot be created, but is accessed through InfiniteApiControllerInterface.getFontLoader.
You may choose to load specific fonts beforehand, in that case when all the fonts are loaded, a FontLoaderInterfaceSignal signal is sent when the loading is over.
Or asynchronously :
Please make sure the destination browser supports promises before using async calls.
Remember that font loading is only used with Annotations.
See