<!--
{
  "availability" : [
    "iOS: 2.0.0 - 7.0.0",
    "iPadOS: 2.0.0 - 7.0.0",
    "tvOS: -",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGTextEncoding",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@E@CGTextEncoding"
  },
  "title" : "CGTextEncoding"
}
-->

# CGTextEncoding

Text encodings for fonts.

```
enum CGTextEncoding
```

## Overview

For more information on setting the font in a graphics context, see [`selectFont(name:size:textEncoding:)`](/documentation/CoreGraphics/CGContext/selectFont(name:size:textEncoding:)).

## Topics

### Constants

[`CGTextEncoding.encodingFontSpecific`](/documentation/CoreGraphics/CGTextEncoding/encodingFontSpecific)

The built-in encoding of the font.

[`CGTextEncoding.encodingMacRoman`](/documentation/CoreGraphics/CGTextEncoding/encodingMacRoman)

The MacRoman encoding. MacRoman is an ASCII variant originally created for use in the Mac OS, in which characters 127 and lower are ASCII, and characters 128 and higher are non-English characters and symbols.



---

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)