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#

PropertyTypeDescription
blockType?"//ly.img.ubq/text""//ly.img.ubq/caption"
mode?"replace""merge"
typeface?objectFont to apply. The engine resolves family against the registered typefaces and matches weight/style. Ignored when the family is empty or not registered.
typeface.familystring-
typeface.weight?FontWeight-
typeface.style?FontStyle-
fontSize?objectScene-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.scalenumber-
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?AssetStylePresetPropertiesThe 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?AssetStylePresetAnimationEntrance animation.
outAnimation?AssetStylePresetAnimationExit animation.
loopAnimation?AssetStylePresetAnimationLooping animation.