The FontsModule
class is used for working with custom fonts in effects.
//==============================================================================
// The following example demonstrates how to access a font in the Assets and
// assign it to a text object.
//
// Project setup:
// - Insert text
// - Add the Custom Fonts capability
//==============================================================================
// Load in the required modules
const Fonts = require('Fonts');
const Scene = require('Scene');
// Locate the font in the Assets and the text in the Scene
const font = Fonts.get('customFont.ttf');
const text = Scene.root.find('text0');
// Set the font of the text
text.font = font;
This module exposes no properties.
Method | Description |
---|---|
findFirst
|
Returns a promise that is resolved with the font identifier of a requested
name or null if none was found. See Also: |
findUsingPattern
|
Returns a promise that is resolved with the all of the font identifiers matching the name pattern or empty array if none was found. Pattern format: Examples:
See Also: |
get
|
Returns a font object identified by the Throws an exception if there is no such font in the project. |
getAll
|
Returns a promise that is resolved with all of the font identifiers. See Also: |
Class | Description |
---|---|
FontId |
The FontsId class identifies a font in an effect. |