<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFont",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@T@CTFontRef"
  },
  "title" : "CTFont"
}
-->

# CTFont

A font object.

```
class CTFont
```

## Overview

The `CTFont` opaque type represents a Core Text font object.

Font objects represent fonts to an application, providing access to characteristics of the font, such as point size, transform matrix, and other attributes. Fonts provide assistance in laying out glyphs relative to one another and are used to establish the current font when drawing in a graphics context.

## Topics

### Creating Fonts

[`CTFontCreateWithName(_:_:_:)`](/documentation/CoreText/CTFontCreateWithName(_:_:_:))

Returns a new font reference for the given name.

[`CTFontCreateWithNameAndOptions(_:_:_:_:)`](/documentation/CoreText/CTFontCreateWithNameAndOptions(_:_:_:_:))

Returns a new font reference for the given name.

[`CTFontCreateWithFontDescriptor(_:_:_:)`](/documentation/CoreText/CTFontCreateWithFontDescriptor(_:_:_:))

Returns a new font reference that best matches the given font descriptor.

[`CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)`](/documentation/CoreText/CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:))

Returns a new font reference that best matches the given font descriptor.

[`CTFontCreateUIFontForLanguage(_:_:_:)`](/documentation/CoreText/CTFontCreateUIFontForLanguage(_:_:_:))

Returns the special user-interface font for the given language and user-interface type.

[`CTFontCreateCopyWithAttributes(_:_:_:_:)`](/documentation/CoreText/CTFontCreateCopyWithAttributes(_:_:_:_:))

Returns a new font with additional attributes based on the original font.

[`CTFontCreateCopyWithSymbolicTraits(_:_:_:_:_:)`](/documentation/CoreText/CTFontCreateCopyWithSymbolicTraits(_:_:_:_:_:))

Returns a new font in the same font family as the original with the specified symbolic traits.

[`CTFontCreateCopyWithFamily(_:_:_:_:)`](/documentation/CoreText/CTFontCreateCopyWithFamily(_:_:_:_:))

Returns a new font in the specified family based on the traits of the original font.

[`CTFontCreateForString(_:_:_:)`](/documentation/CoreText/CTFontCreateForString(_:_:_:))

Returns a font reference that most accurately maps the string range based on the current font.

[`CTFontCreateForStringWithLanguage(_:_:_:_:)`](/documentation/CoreText/CTFontCreateForStringWithLanguage(_:_:_:_:))

Returns a font reference that most accurately maps the string range based on the current font and language.

### Getting Font Data

[`CTFontCopyFontDescriptor(_:)`](/documentation/CoreText/CTFontCopyFontDescriptor(_:))

Returns the normalized font descriptor for the given font reference.

[`CTFontCopyAttribute(_:_:)`](/documentation/CoreText/CTFontCopyAttribute(_:_:))

Returns the value associated with an arbitrary attribute of the given font.

[`CTFontGetSize(_:)`](/documentation/CoreText/CTFontGetSize(_:))

Returns the point size of the given font.

[`CTFontGetMatrix(_:)`](/documentation/CoreText/CTFontGetMatrix(_:))

Returns the transformation matrix of the given font.

[`CTFontGetSymbolicTraits(_:)`](/documentation/CoreText/CTFontGetSymbolicTraits(_:))

Returns the symbolic traits of the given font.

[`CTFontCopyTraits(_:)`](/documentation/CoreText/CTFontCopyTraits(_:))

Returns the traits dictionary of the given font.

[`CTFontCopyDefaultCascadeListForLanguages(_:_:)`](/documentation/CoreText/CTFontCopyDefaultCascadeListForLanguages(_:_:))

Retrieves an ordered list of font substitution preferences.

### Getting Font Names

[`CTFontCopyPostScriptName(_:)`](/documentation/CoreText/CTFontCopyPostScriptName(_:))

Returns the PostScript name of the given font.

[`CTFontCopyFamilyName(_:)`](/documentation/CoreText/CTFontCopyFamilyName(_:))

Returns the family name of the given font.

[`CTFontCopyFullName(_:)`](/documentation/CoreText/CTFontCopyFullName(_:))

Returns the full name of the given font.

[`CTFontCopyDisplayName(_:)`](/documentation/CoreText/CTFontCopyDisplayName(_:))

Returns the display name of the given font.

[`CTFontCopyName(_:_:)`](/documentation/CoreText/CTFontCopyName(_:_:))

Returns a reference to the requested name of the given font.

[`CTFontCopyLocalizedName(_:_:_:)`](/documentation/CoreText/CTFontCopyLocalizedName(_:_:_:))

Returns a reference to a localized name for the given font.

### Working With Encoding

[`CTFontCopyCharacterSet(_:)`](/documentation/CoreText/CTFontCopyCharacterSet(_:))

Returns the Unicode character set of the font.

[`CTFontGetStringEncoding(_:)`](/documentation/CoreText/CTFontGetStringEncoding(_:))

Returns the best string encoding for legacy format support.

[`CTFontCopySupportedLanguages(_:)`](/documentation/CoreText/CTFontCopySupportedLanguages(_:))

Returns an array of languages supported by the font.

### Getting Font Metrics

[`CTFontGetAscent(_:)`](/documentation/CoreText/CTFontGetAscent(_:))

Returns the scaled font-ascent metric of the given font.

[`CTFontGetDescent(_:)`](/documentation/CoreText/CTFontGetDescent(_:))

Returns the scaled font-descent metric of the given font.

[`CTFontGetLeading(_:)`](/documentation/CoreText/CTFontGetLeading(_:))

Returns the scaled font-leading metric of the given font.

[`CTFontGetUnitsPerEm(_:)`](/documentation/CoreText/CTFontGetUnitsPerEm(_:))

Returns the units-per-em metric of the given font.

[`CTFontGetGlyphCount(_:)`](/documentation/CoreText/CTFontGetGlyphCount(_:))

Returns the number of glyphs of the given font.

[`CTFontGetBoundingBox(_:)`](/documentation/CoreText/CTFontGetBoundingBox(_:))

Returns the scaled bounding box of the given font.

[`CTFontGetUnderlinePosition(_:)`](/documentation/CoreText/CTFontGetUnderlinePosition(_:))

Returns the scaled underline position of the given font.

[`CTFontGetUnderlineThickness(_:)`](/documentation/CoreText/CTFontGetUnderlineThickness(_:))

Returns the scaled underline-thickness metric of the given font.

[`CTFontGetSlantAngle(_:)`](/documentation/CoreText/CTFontGetSlantAngle(_:))

Returns the slant angle of the given font.

[`CTFontGetCapHeight(_:)`](/documentation/CoreText/CTFontGetCapHeight(_:))

Returns the cap-height metric of the given font.

[`CTFontGetXHeight(_:)`](/documentation/CoreText/CTFontGetXHeight(_:))

Returns the x-height metric of the given font.

### Getting Glyph Data

[`CTFontCreatePathForGlyph(_:_:_:)`](/documentation/CoreText/CTFontCreatePathForGlyph(_:_:_:))

Creates a path for the specified glyph.

[`CTFontGetGlyphWithName(_:_:)`](/documentation/CoreText/CTFontGetGlyphWithName(_:_:))

Returns the glyph for the specified name.

[`CTFontGetBoundingRectsForGlyphs(_:_:_:_:_:)`](/documentation/CoreText/CTFontGetBoundingRectsForGlyphs(_:_:_:_:_:))

Calculates the bounding rects for an array of glyphs and returns the overall bounding rectangle for the glyph run.

[`CTFontGetAdvancesForGlyphs(_:_:_:_:_:)`](/documentation/CoreText/CTFontGetAdvancesForGlyphs(_:_:_:_:_:))

Calculates the advances for an array of glyphs and returns the summed advance.

[`CTFontGetOpticalBoundsForGlyphs(_:_:_:_:_:)`](/documentation/CoreText/CTFontGetOpticalBoundsForGlyphs(_:_:_:_:_:))

Calculates the optical bounds for an array of glyphs and returns the overall optical bounds for the run.

[`CTFontGetVerticalTranslationsForGlyphs(_:_:_:_:)`](/documentation/CoreText/CTFontGetVerticalTranslationsForGlyphs(_:_:_:_:))

Calculates the offset from the default (horizontal) origin to the vertical origin for an array of glyphs.

### Working With Font Variations

[`CTFontCopyVariationAxes(_:)`](/documentation/CoreText/CTFontCopyVariationAxes(_:))

Returns an array of variation axes.

[`CTFontCopyVariation(_:)`](/documentation/CoreText/CTFontCopyVariation(_:))

Returns a variation dictionary from the font reference.

### Getting Font Features

[`CTFontCopyFeatures(_:)`](/documentation/CoreText/CTFontCopyFeatures(_:))

Returns an array of font features.

[`CTFontCopyFeatureSettings(_:)`](/documentation/CoreText/CTFontCopyFeatureSettings(_:))

Returns an array of font feature-setting tuples.

### Working with Glyphs

[`CTFontGetGlyphsForCharacters(_:_:_:_:)`](/documentation/CoreText/CTFontGetGlyphsForCharacters(_:_:_:_:))

Performs basic character-to-glyph mapping.

[`CTFontDrawGlyphs(_:_:_:_:_:)`](/documentation/CoreText/CTFontDrawGlyphs(_:_:_:_:_:))

Renders the given glyphs of a font at the specified positions in the supplied graphics context.

[`CTFontGetLigatureCaretPositions(_:_:_:_:)`](/documentation/CoreText/CTFontGetLigatureCaretPositions(_:_:_:_:))

Returns caret positions within a glyph.

### Converting Fonts

[`CTFontCopyGraphicsFont(_:_:)`](/documentation/CoreText/CTFontCopyGraphicsFont(_:_:))

Returns a Core Graphics font reference and attributes.

[`CTFontCreateWithGraphicsFont(_:_:_:_:)`](/documentation/CoreText/CTFontCreateWithGraphicsFont(_:_:_:_:))

Creates a new font reference from an existing Core Graphics font reference.

[`CTFontGetPlatformFont(_:_:)`](/documentation/CoreText/CTFontGetPlatformFont(_:_:))

Returns an ATS font reference and attributes.

[`CTFontCreateWithPlatformFont(_:_:_:_:)`](/documentation/CoreText/CTFontCreateWithPlatformFont(_:_:_:_:))

Creates a new font reference from an ATS font reference.

[`CTFontCreateWithQuickdrawInstance(_:_:_:_:)`](/documentation/CoreText/CTFontCreateWithQuickdrawInstance(_:_:_:_:))

Returns a font reference for the given QuickDraw instance.

### Getting Font Table Data

[`CTFontCopyAvailableTables(_:_:)`](/documentation/CoreText/CTFontCopyAvailableTables(_:_:))

Returns an array of font table tags.

[`CTFontCopyTable(_:_:_:)`](/documentation/CoreText/CTFontCopyTable(_:_:_:))

Returns a reference to the font table data.

### Getting the Type Identifier

[`CTFontGetTypeID()`](/documentation/CoreText/CTFontGetTypeID())

Returns the type identifier for Core Text font references.

### Global Variables

[Name Specifier Constants](/documentation/CoreText/name-specifier-constants)

Name specifier constants provide access to the different names associated with a font.

[Font Variation Axis Dictionary Keys](/documentation/CoreText/font-variation-axis-dictionary-keys)

These constants provide keys to font variation axis dictionary values.

[Font Feature Constants](/documentation/CoreText/font-feature-constants)

These constants provide keys to font feature dictionary values.

### Enumerations

[`CTFontUIFontType`](/documentation/CoreText/CTFontUIFontType)

Constants that represent the specific user-interface purpose to specify for font creation.

[`CTFontTableTag`](/documentation/CoreText/CTFontTableTag)

Font table tags provide access to font table data.

[`CTFontTableOptions`](/documentation/CoreText/CTFontTableOptions)

Constants that describe font table options.

[`CTFontOptions`](/documentation/CoreText/CTFontOptions)

Options for font creation and descriptor matching.



---

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)