Skip to main content

Module text_animation

Module text_animation 

Source
Expand description

Text animators applied to a laid-out text: each cluster’s selection and resulting state.

Selection follows After Effects’ text animators. A Range selector counts units (characters, non-space characters, words or lines) and shapes its range at the ends. A Timing selector picks the characters of runs by the run’s time against the current time. A Class selector picks the characters of runs that carry a class. Only + - * / and sqrt enter the selection, so native and wasm agree bit for bit.

Functions§

cluster_states
Each cluster’s state under animators at time, in pixels of a font_size-pixel font, and a hash of the states. The hash is 0 when every state is identity, so the text draws as it would without animators. base_fill and base_stroke are where color mixes start.
selection
The selection in [0, 1] that selector gives each cluster of layout, at time for a Timing selector. runs is empty for a plain string.