Search Docs
Loading...
Skip to content

Interface: AssetStylePreset

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"
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.