<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNText",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNText"
  },
  "title" : "SCNText"
}
-->

# SCNText

A geometry based on a string of text, optionally extruded to create a three-dimensional object.

```
class SCNText
```

## Overview

![](images/com.apple.scenekit/media-2929805@2x.png)

You provide text for the geometry using an <doc://com.apple.documentation/documentation/Foundation/NSString> or <doc://com.apple.documentation/documentation/Foundation/NSAttributedString> object. In the former case, the properties of the [`SCNText`](/documentation/SceneKit/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`](/documentation/SceneKit/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 [`extrusionDepth`](/documentation/SceneKit/SCNText/extrusionDepth) property is `1.0`, the geometry extends from `-0.5` to `0.5` 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.0`, and viewable only from its front unless its material’s [`isDoubleSided`](/documentation/SceneKit/SCNMaterial/isDoubleSided) property is <doc://com.apple.documentation/documentation/Swift/true>.

To position and orient a text geometry in a scene, attach it to the [`geometry`](/documentation/SceneKit/SCNNode/geometry) property of an [`SCNNode`](/documentation/SceneKit/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 ``doc://com.apple.scenekit/documentation/SceneKit/SCNNode/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 [`chamferRadius`](/documentation/SceneKit/SCNText/chamferRadius) property to add a chamfer to the extruded text, and the [`chamferProfile`](/documentation/SceneKit/SCNText/chamferProfile) property to control the shape of the chamfer.

A text geometry may contain one, three, or five geometry elements:

- If its [`extrusionDepth`](/documentation/SceneKit/SCNText/extrusionDepth) property is `0.0`, the text geometry has one element corresponding to its one visible side.
- If its extrusion depth is greater than zero and its [`chamferRadius`](/documentation/SceneKit/SCNText/chamferRadius) property is `0.0`, the text geometry has three elements, corresponding to its front, back, and extruded sides.
- 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`](/documentation/SceneKit/SCNGeometry/materials) property in [`SCNGeometry`](/documentation/SceneKit/SCNGeometry).

## Topics

### Creating a Text Geometry

[`+  textWithString:extrusionDepth:`](/documentation/SceneKit/SCNText/init(string:extrusionDepth:))

Creates a text geometry from a specified string, extruded with a specified depth.

### Managing the Geometry’s Text Content

[`string`](/documentation/SceneKit/SCNText/string)

The string object whose text the geometry represents.

[`font`](/documentation/SceneKit/SCNText/font)

The font that SceneKit uses to create geometry from the text.

### Managing Text Layout

[`containerFrame`](/documentation/SceneKit/SCNText/containerFrame)

A rectangle specifying the area in which SceneKit should lay out the text.

[`wrapped`](/documentation/SceneKit/SCNText/isWrapped)

A Boolean value that specifies whether SceneKit wraps long lines of text.

[`alignmentMode`](/documentation/SceneKit/SCNText/alignmentMode)

A constant that specifies how SceneKit horizontally aligns each line of text within its container.

[`truncationMode`](/documentation/SceneKit/SCNText/truncationMode)

A constant that specifies how SceneKit truncates text that is too long to fit its container.

[`textSize`](/documentation/SceneKit/SCNText/textSize)

The two-dimensional extent of the text after layout.

### Managing the Text’s 3D Representation

[`flatness`](/documentation/SceneKit/SCNText/flatness)

A number that determines the accuracy or smoothness of the text geometry.

[`extrusionDepth`](/documentation/SceneKit/SCNText/extrusionDepth)

The extent of the extruded text in the z-axis direction. Animatable.

[`chamferRadius`](/documentation/SceneKit/SCNText/chamferRadius)

The width or depth of each chamfered edge. Animatable.

[`chamferSegmentCount`](/documentation/SceneKit/SCNText/chamferSegmentCount)

The number of divisions SceneKit uses to create each chamfered edge of the text geometry. Animatable.

[`chamferProfile`](/documentation/SceneKit/SCNText/chamferProfile)

A path that determines the cross-sectional contour of each chamfered edge.

## Relationships

### Inherits From

[`SCNGeometry`](/documentation/SceneKit/SCNGeometry)

### Conforms To

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SCNAnimatable`](/documentation/SceneKit/SCNAnimatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`SCNShadable`](/documentation/SceneKit/SCNShadable)

[`Hashable`](/documentation/Swift/Hashable)

[`SCNBoundingVolume`](/documentation/SceneKit/SCNBoundingVolume)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)