A geometry based on a string of text, optionally extruded to create a three-dimensional object.
SDKs
- iOS 8.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Scene
Kit
Declaration
class SCNText : SCNGeometry
Overview
An example scene containing 3D text

You provide text for the geometry using an NSString
or NSAttributed
object. In the former case, the properties of the SCNText
object determine the style and formatting of the entire body of text. When you create a text geometry from an attributed string, SceneKit styles the text according to the attributes in the string, and the properties of the SCNText
object determine the default style for portions of the string that have no style attributes. SceneKit can create text geometry using any font and style supported by the Core Text framework, with the exception of bitmap fonts (such as those that define color emoji characters).
In the local coordinate system of the text geometry, the origin corresponds to the lower left corner of the text, with the text extending in the x- and y-axis dimensions. The geometry is centered along its z-axis. For example, if its extrusion
property is 1
, the geometry extends from -0
to 0
along the z-axis. An extrusion depth of zero creates a flat, one-sided shape—the geometry is confined to the plane whose z-coordinate is 0
, and viewable only from its front unless its material’s is
property is true
.
To position and orient a text geometry in a scene, attach it to the geometry
property of an SCNNode
object.
Note
SceneKit creates geometry from text in a local coordinate system where one unit is one typographic point. For example, a text geometry whose font is Helvetica 36 (the default) may be up to 36 units tall. If your scene is arranged on a different scale, use the scale
property of the node containing the text geometry to make it fit within your scene.
SceneKit can optionally chamfer an extruded text geometry by applying a cross-sectional contour to its extruded depth. You use the chamfer
property to add a chamfer to the extruded text, and the chamfer
property to control the shape of the chamfer.
A text geometry may contain one, three, or five geometry elements:
If its
extrusion
property isDepth 0
, the text geometry has one element corresponding to its one visible side..0 If its extrusion depth is greater than zero and its
chamfer
property isRadius 0
, the text geometry has three elements, corresponding to its front, back, and extruded sides..0 If both extrusion depth and chamfer radius are greater than zero, the text geometry has five elements, corresponding to its front, back, extruded sides, front chamfer, and back chamfer.
SceneKit can render each element using a different material. For details, see the description of the materials
property in SCNGeometry
.