Text & Fonts
2D and 3D text, fonts, text styling, and localization.
Commonly used
TextRenders 2D text with specific style and layout.Text3DRenders 3D text with specific style, layout and material.FontA font asset used for rendering text.LocalizationSystemHelps convert data types to localized string representations.TextFillFill settings used by several text related classes.
Guides
Native KeyboardTo use the keyboard in Lenses, enable the Editable checkbox on a Text or Text3D component.Rich TextRich text allows a singular Text or Text3D component to have multiple styles, including font, size, underline, and more.LocalizationLocalizations Assets allow you to localize text in your Lens so that users all around the world can use it.Shareable Text EditsLets Snapchatters edit, persist, and share in-Lens text.Text 3DThe Text3D Component lets you convert any text into a 3D object in Lens Studio.Text OverviewThe Text component allows you to add text to your Lens experience.
All APIs in this topic
Add components to a scene object and reference assets and other modules with a script input.
Components, assets, and modules
| API | Description |
|---|---|
| Font | A font asset used for rendering text. |
| FontCollection | An ordered collection of Font and FontFamily assets, allowing a Text component to access multiple fonts and font families. |
| FontFamily | Groups multiple Font assets into a single family, mapping each to a style (weight + italic). |
| LocalizationsAsset | Asset that provides the necessary localized text for your Lens. |
| Text | Renders 2D text with specific style and layout. |
| Text3D | Renders 3D text with specific style, layout and material. |
Objects and data
| API | Description |
|---|---|
| BackgroundSettings | Settings for rendering the background on a Text component. |
| CursorPosition | The position of a text cursor for a given character index, returned by Text.getCursorPositions and Text3D.getCursorPositions. |
| CustomVariationStyle | A user-defined named style on a variable Font. |
| DropshadowSettings | Used in Text's dropShadowSettings property. |
| FontCollectionEntry | Represents a single entry in a FontCollection. |
| FontFamilyEntry | Represents a single entry in a FontFamily, mapping a Font asset to a style (weight + italic). |
| LocalizationSystem | Helps convert data types to localized string representations. |
| NamedInstanceInfo | Read-only named axis preset from the font's fvar table, for example "Condensed Bold". |
| OutlineSettings | Used in Text's outlineSettings property. |
| TextFill | Fill settings used by several text related classes. |
| TextProvider | Controls a text rendering texture. |
| VariationAxisInfo | Read-only metadata describing one OpenType variation axis on a variable font. |
Enums
| API | Description |
|---|---|
| CapitalizationOverride | Changes the capitalization of the text component. |
| FontStyles | |
| HorizontalAlignment | Used by the horizontalAlignment property in MeshVisual. |
| HorizontalOverflow | Options for wrapping text horizontally. |
| Text3DExtrudeDirection | Controls the direction in which Text3D meshes are extruded relative to the component's local position. |
| TextFillMode | Used in TextFill's mode property. |
| TileZone | Defines the bounding area used for texture tiling with TextFill's tileZone property. |
| VerticalAlignment | Used by the verticalAlignment property in MeshVisual. |
| VerticalOverflow | Options for handling vertical text overflow. |