CustomVariationStyle
ClassA user-defined named style on a variable Font.
- Available on all platforms
A user-defined named style on a variable Font. Holds the standard variation
axis values (weight, width, slant, italic, opticalSize) plus any custom axes the font
exposes (e.g. GRAD, YOPQ). Create via Font.createVariationStyle.
Index
Properties
Methods
Example
//@input Asset.Font fontAsset
//@input Component.Text text
var style = script.fontAsset.createVariationStyle("CustomStyle");
style.weight = 565;
style.GRAD = 14;
script.text.preferredStyle = style.name;
Extends
Indexable
[
index:string]:any
Properties
italic
italic:
boolean
Italic axis value (ital). If no ital axis is present, changes slant axis value (slnt) instead.
Since
Lens Scripting Version 372
Default Value
false
name
readonlyname:string
Name of the custom variation style. Used to assign to Text.preferredStyle to change style to custom style.
Since
Lens Scripting Version 372
opticalSize
opticalSize:
number
Optical size axis value (opsz).
Since
Lens Scripting Version 372
Default Value
48
slant
slant:
number
Slant axis value (slnt), in degrees.
Since
Lens Scripting Version 372
Default Value
0
weight
weight:
number
Weight axis value (wght).
Since
Lens Scripting Version 372
Default Value
400
width
width:
number
Width axis value (wdth).
Since
Lens Scripting Version 372
Default Value
100
Methods
getTypeName()
staticgetTypeName():TypeName<CustomVariationStyle>
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<CustomVariationStyle>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean