A declarative style preset the engine applies to text and caption blocks. The engine parses and applies it identically on every platform. Lives in AssetPayload.stylePreset.
Most of the look is in AssetStylePreset.properties; the other fields cover the font, size-relative scaling and animations.
Properties#
| Property | Type | Description |
|---|---|---|
blockType? |
"//ly.img.ubq/text" |
"//ly.img.ubq/caption" |
mode? |
"replace" |
"merge" |
keepExisting? |
AssetStylePresetKeptProperty[] |
The properties that applying the preset to an existing block leaves as they are, such as ['text', 'typeface']. The preset neither writes them nor clears them in 'replace' mode. List 'typeface' to keep the font. A kept fontSize also stops fontSize.resizeExistingOnApply, and a kept fill/solid/color also keeps the text color. The animations follow mode, not this list. engine.asset.apply creates a block from the preset and writes every property, the kept ones included. applyToBlock never writes them, also on a block that the caller has just created, such as a new caption that the editor styles. Defaults to ['text'], so a preset without this list keeps the block’s text. A list replaces the default: add 'text' to keep the text too. |
typeface? |
object |
Font to apply. The engine resolves family against the registered typefaces and matches weight/style. Ignored when the family is empty or not registered. |
typeface.family |
string |
- |
typeface.weight? |
FontWeight |
- |
typeface.style? |
FontStyle |
- |
fontSize? |
object |
Scene-relative font size. scale is a unitless multiplier on the scene’s base font size (1 = the base size), sizing a block created from the preset. With resizeExistingOnApply: true the same size also resizes an existing block on apply. For an absolute size, set properties['text/fontSize'] instead (it takes precedence). |
fontSize.scale |
number |
- |
fontSize.resizeExistingOnApply? |
boolean |
- |
scaleWithFontSize? |
object[] |
Lengths that scale with the block’s font size. Each entry sets its property to ratio × fontSize — e.g. { property: 'stroke/width', ratio: 0.012 } makes the stroke width 0.012 × fontSize. Keeps a preset’s stroke width, drop-shadow offset/blur, … proportional at any size. |
properties? |
AssetStylePresetProperties |
The bulk of the look: typography plus the fill/*, stroke/*, dropShadow/* and backgroundColor/* decorations with their …/enabled toggles. Known paths are value-checked and autocomplete. See AssetStylePresetProperties. |
inAnimation? |
AssetStylePresetAnimation |
Entrance animation. |
outAnimation? |
AssetStylePresetAnimation |
Exit animation. |
loopAnimation? |
AssetStylePresetAnimation |
Looping animation. |