The font source used to resolve text in the vector content — a
Font, FontFamily, or FontCollection asset, exactly
like Text#fontSource. Text is resolved per run: each <text> (or
positioned <tspan>) element in the SVG is one run of text. A
Font is used for every run. For a FontFamily or
FontCollection, each run's font-family attribute selects a face
within the source; a run whose font-family does not match still uses
the source's default style. The system font is used only when no source
is assigned, or for a run whose font-family is "System".
Assignable at runtime; a Font referenced only through this property is
still shipped with the Lens.
ReadonlyintrinsicThe natural size of the source content — the SVG viewBox for a loaded SVG, or the canvas size passed to VectorCompositeBuilder.create for a builder-constructed composite. Reported as (0, 0) until the asset is ready.
ReadonlyisTrue once the retained scene is built (i.e. once VectorComposite#ready
has resolved). Not ready means the SVG has not been parsed and tessellated yet:
before ready is first called, while that one-time build is in flight, or after
a parse failure (where ready rejects and the asset stays not ready). While not
ready, VectorComposite#intrinsicSize reads (0, 0) and drawing the asset
with a VectorRenderer throws. A cheap synchronous guard to check before
drawing.
The name of the Asset in Lens Studio.
ReadonlyuniqueStaticgetReturns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Returns a Promise that resolves once the source has been parsed and tessellated into the retained scene and the asset is ready to draw; rejects with a parse / unsupported-feature error on failure. The first call kicks off the one-time asynchronous build (parse + tessellate); the same Promise is returned on subsequent calls.
A retained, tessellated vector-image asset (built from an SVG document). The asset itself produces no image; a VectorRenderer draws it into a caller-owned render-target Texture. Wait for VectorComposite#ready (or poll VectorComposite#isReady) before drawing.
Since
Lens Scripting Version 368
Snap OS
Example