---
title: CTFont
framework: coretext
role: symbol
role_heading: Class
path: coretext/ctfont
---

# CTFont

A font object.

## Declaration

```swift
class CTFont
```

## Overview

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(_:_:_:)](coretext/ctfontcreatewithname(_:_:_:).md)
- [CTFontCreateWithNameAndOptions(_:_:_:_:)](coretext/ctfontcreatewithnameandoptions(_:_:_:_:).md)
- [CTFontCreateWithFontDescriptor(_:_:_:)](coretext/ctfontcreatewithfontdescriptor(_:_:_:).md)
- [CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)](coretext/ctfontcreatewithfontdescriptorandoptions(_:_:_:_:).md)
- [CTFontCreateUIFontForLanguage(_:_:_:)](coretext/ctfontcreateuifontforlanguage(_:_:_:).md)
- [CTFontCreateCopyWithAttributes(_:_:_:_:)](coretext/ctfontcreatecopywithattributes(_:_:_:_:).md)
- [CTFontCreateCopyWithSymbolicTraits(_:_:_:_:_:)](coretext/ctfontcreatecopywithsymbolictraits(_:_:_:_:_:).md)
- [CTFontCreateCopyWithFamily(_:_:_:_:)](coretext/ctfontcreatecopywithfamily(_:_:_:_:).md)
- [CTFontCreateForString(_:_:_:)](coretext/ctfontcreateforstring(_:_:_:).md)
- [CTFontCreateForStringWithLanguage(_:_:_:_:)](coretext/ctfontcreateforstringwithlanguage(_:_:_:_:).md)

### Getting Font Data

- [CTFontCopyFontDescriptor(_:)](coretext/ctfontcopyfontdescriptor(_:).md)
- [CTFontCopyAttribute(_:_:)](coretext/ctfontcopyattribute(_:_:).md)
- [CTFontGetSize(_:)](coretext/ctfontgetsize(_:).md)
- [CTFontGetMatrix(_:)](coretext/ctfontgetmatrix(_:).md)
- [CTFontGetSymbolicTraits(_:)](coretext/ctfontgetsymbolictraits(_:).md)
- [CTFontCopyTraits(_:)](coretext/ctfontcopytraits(_:).md)
- [CTFontCopyDefaultCascadeListForLanguages(_:_:)](coretext/ctfontcopydefaultcascadelistforlanguages(_:_:).md)

### Getting Font Names

- [CTFontCopyPostScriptName(_:)](coretext/ctfontcopypostscriptname(_:).md)
- [CTFontCopyFamilyName(_:)](coretext/ctfontcopyfamilyname(_:).md)
- [CTFontCopyFullName(_:)](coretext/ctfontcopyfullname(_:).md)
- [CTFontCopyDisplayName(_:)](coretext/ctfontcopydisplayname(_:).md)
- [CTFontCopyName(_:_:)](coretext/ctfontcopyname(_:_:).md)
- [CTFontCopyLocalizedName(_:_:_:)](coretext/ctfontcopylocalizedname(_:_:_:).md)

### Working With Encoding

- [CTFontCopyCharacterSet(_:)](coretext/ctfontcopycharacterset(_:).md)
- [CTFontGetStringEncoding(_:)](coretext/ctfontgetstringencoding(_:).md)
- [CTFontCopySupportedLanguages(_:)](coretext/ctfontcopysupportedlanguages(_:).md)

### Getting Font Metrics

- [CTFontGetAscent(_:)](coretext/ctfontgetascent(_:).md)
- [CTFontGetDescent(_:)](coretext/ctfontgetdescent(_:).md)
- [CTFontGetLeading(_:)](coretext/ctfontgetleading(_:).md)
- [CTFontGetUnitsPerEm(_:)](coretext/ctfontgetunitsperem(_:).md)
- [CTFontGetGlyphCount(_:)](coretext/ctfontgetglyphcount(_:).md)
- [CTFontGetBoundingBox(_:)](coretext/ctfontgetboundingbox(_:).md)
- [CTFontGetUnderlinePosition(_:)](coretext/ctfontgetunderlineposition(_:).md)
- [CTFontGetUnderlineThickness(_:)](coretext/ctfontgetunderlinethickness(_:).md)
- [CTFontGetSlantAngle(_:)](coretext/ctfontgetslantangle(_:).md)
- [CTFontGetCapHeight(_:)](coretext/ctfontgetcapheight(_:).md)
- [CTFontGetXHeight(_:)](coretext/ctfontgetxheight(_:).md)

### Getting Glyph Data

- [CTFontCreatePathForGlyph(_:_:_:)](coretext/ctfontcreatepathforglyph(_:_:_:).md)
- [CTFontGetGlyphWithName(_:_:)](coretext/ctfontgetglyphwithname(_:_:).md)
- [CTFontGetBoundingRectsForGlyphs(_:_:_:_:_:)](coretext/ctfontgetboundingrectsforglyphs(_:_:_:_:_:).md)
- [CTFontGetAdvancesForGlyphs(_:_:_:_:_:)](coretext/ctfontgetadvancesforglyphs(_:_:_:_:_:).md)
- [CTFontGetOpticalBoundsForGlyphs(_:_:_:_:_:)](coretext/ctfontgetopticalboundsforglyphs(_:_:_:_:_:).md)
- [CTFontGetVerticalTranslationsForGlyphs(_:_:_:_:)](coretext/ctfontgetverticaltranslationsforglyphs(_:_:_:_:).md)

### Working With Font Variations

- [CTFontCopyVariationAxes(_:)](coretext/ctfontcopyvariationaxes(_:).md)
- [CTFontCopyVariation(_:)](coretext/ctfontcopyvariation(_:).md)

### Getting Font Features

- [CTFontCopyFeatures(_:)](coretext/ctfontcopyfeatures(_:).md)
- [CTFontCopyFeatureSettings(_:)](coretext/ctfontcopyfeaturesettings(_:).md)

### Working with Glyphs

- [CTFontGetGlyphsForCharacters(_:_:_:_:)](coretext/ctfontgetglyphsforcharacters(_:_:_:_:).md)
- [CTFontDrawGlyphs(_:_:_:_:_:)](coretext/ctfontdrawglyphs(_:_:_:_:_:).md)
- [CTFontGetLigatureCaretPositions(_:_:_:_:)](coretext/ctfontgetligaturecaretpositions(_:_:_:_:).md)

### Converting Fonts

- [CTFontCopyGraphicsFont(_:_:)](coretext/ctfontcopygraphicsfont(_:_:).md)
- [CTFontCreateWithGraphicsFont(_:_:_:_:)](coretext/ctfontcreatewithgraphicsfont(_:_:_:_:).md)
- [CTFontGetPlatformFont(_:_:)](coretext/ctfontgetplatformfont(_:_:).md)
- [CTFontCreateWithPlatformFont(_:_:_:_:)](coretext/ctfontcreatewithplatformfont(_:_:_:_:).md)
- [CTFontCreateWithQuickdrawInstance(_:_:_:_:)](coretext/ctfontcreatewithquickdrawinstance(_:_:_:_:).md)

### Getting Font Table Data

- [CTFontCopyAvailableTables(_:_:)](coretext/ctfontcopyavailabletables(_:_:).md)
- [CTFontCopyTable(_:_:_:)](coretext/ctfontcopytable(_:_:_:).md)

### Getting the Type Identifier

- [CTFontGetTypeID()](coretext/ctfontgettypeid().md)

### Global Variables

- [Name Specifier Constants](coretext/name-specifier-constants.md)
- [Font Variation Axis Dictionary Keys](coretext/font-variation-axis-dictionary-keys.md)
- [Font Feature Constants](coretext/font-feature-constants.md)

### Enumerations

- [CTFontUIFontType](coretext/ctfontuifonttype.md)
- [CTFontTableTag](coretext/ctfonttabletag.md)
- [CTFontTableOptions](coretext/ctfonttableoptions.md)
- [CTFontOptions](coretext/ctfontoptions.md)

### Initializers

- [init(_:size:)](coretext/ctfont/init(_:size:)-3do9m.md)
- [init(_:size:)](coretext/ctfont/init(_:size:)-6lcja.md)
- [init(_:size:)](coretext/ctfont/init(_:size:)-8bj7b.md)
- [init(_:size:language:)](coretext/ctfont/init(_:size:language:).md)
- [init(_:transform:)](coretext/ctfont/init(_:transform:)-3sscp.md)
- [init(_:transform:)](coretext/ctfont/init(_:transform:)-a23v.md)
- [init(font:string:range:)](coretext/ctfont/init(font:string:range:).md)
- [init(font:string:range:language:)](coretext/ctfont/init(font:string:range:language:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Opaque Types

- [CTFontCollection](coretext/ctfontcollection.md)
- [CTFontDescriptor](coretext/ctfontdescriptor.md)
- [CTFrame](coretext/ctframe.md)
- [CTFramesetter](coretext/ctframesetter.md)
- [CTGlyphInfo](coretext/ctglyphinfo.md)
- [CTLine](coretext/ctline.md)
- [CTParagraphStyle](coretext/ctparagraphstyle.md)
- [CTRun](coretext/ctrun.md)
- [CTRunDelegate](coretext/ctrundelegate.md)
- [CTTextTab](coretext/cttexttab.md)
- [CTTypesetter](coretext/cttypesetter.md)
