FontCollectionEntry
ClassRepresents a single entry in a FontCollection.
- Available on all platforms
Since Lens Scripting v356
Represents a single entry in a FontCollection. Each entry holds an asset reference (either a Font or FontFamily) along with a weight and italic flag that determine the style the entry maps to. For FontFamily entries, weight and italic are ignored.
Index
Properties
Methods
Properties
asset
asset:
Font|FontFamily
The Font or FontFamily asset for this entry.
Since
Lens Scripting Version 356
Default Value
null
italic
italic:
boolean
Whether this entry maps to an italic style. Ignored for FontFamily entries.
Since
Lens Scripting Version 356
Default Value
false
weight
weight:
number
The font weight this entry maps to (e.g. 400 for Regular, 700 for Bold). Ignored for FontFamily entries.
Since
Lens Scripting Version 356
Default Value
400
Methods
create()
staticcreate():FontCollectionEntry
Creates a new FontCollectionEntry with default values.
Returns
FontCollectionEntry
Since
Lens Scripting Version 356
Example
//@input Asset.Font fontBold
//@input Asset.FontFamily myFamily
// Font entry — weight and italic determine the style it maps to
var fontEntry = FontCollectionEntry.create();
fontEntry.asset = script.fontBold;
fontEntry.weight = 700;
// FontFamily entry — weight and italic are ignored
var familyEntry = FontCollectionEntry.create();
familyEntry.asset = script.myFamily;
getTypeName()
staticgetTypeName():TypeName<FontCollectionEntry>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<FontCollectionEntry>
Since
Lens Scripting Version 356