<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFont",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIFont"
  },
  "title" : "UIFont"
}
-->

# UIFont

An object that provides access to the font’s characteristics.

```
class UIFont
```

## Overview

Use `UIFont` to access your font’s characteristics within your app. It also provides the system with access to the glyph information, used during layout. Font objects are immutable, so it’s safe to use them from multiple threads in your app.

In Objective-C, don’t create font objects using the `alloc` and `init` methods. Instead, use class methods of [`UIFont`](/documentation/UIKit/UIFont), such as [`preferredFont(forTextStyle:)`](/documentation/UIKit/UIFont/preferredFont(forTextStyle:)), to look up and retrieve the desired font object. These methods check for an existing font object with the specified characteristics and return it if it exists. Otherwise, they create a new font object based on the desired font characteristics.

## Topics

### Creating Fonts

[Scaling fonts automatically](/documentation/UIKit/scaling-fonts-automatically)

Scale text in your interface automatically using Dynamic Type.

[Creating self-sizing table view cells](/documentation/UIKit/creating-self-sizing-table-view-cells)

Create table view cells that support Dynamic Type and use system spacing constraints to adjust the spacing surrounding text labels.

[`preferredFont(forTextStyle:)`](/documentation/UIKit/UIFont/preferredFont(forTextStyle:))

Returns an instance of the system font for the specified text style with scaling for the user’s selected content size category.

[`preferredFont(forTextStyle:compatibleWith:)`](/documentation/UIKit/UIFont/preferredFont(forTextStyle:compatibleWith:))

Returns an instance of the system font for the appropriate text style and traits.

[`UIFont.TextStyle`](/documentation/UIKit/UIFont/TextStyle)

Constants that describe the preferred styles for fonts.

[`init(name:size:)`](/documentation/UIKit/UIFont/init(name:size:))

Creates and returns a font object for the specified font name and size.

[`init(descriptor:size:)`](/documentation/UIKit/UIFont/init(descriptor:size:))

Returns a font that matches the specified font descriptor.

[`withSize(_:)`](/documentation/UIKit/UIFont/withSize(_:))

Returns a font object that is the same as the font, but has the specified size.

### Creating System Fonts

[`systemFont(ofSize:)`](/documentation/UIKit/UIFont/systemFont(ofSize:))

Returns the font object for standard interface items in the specified size.

[`systemFont(ofSize:weight:)`](/documentation/UIKit/UIFont/systemFont(ofSize:weight:))

Returns the font object for standard interface items in the specified size and weight.

[`UIFont.Weight`](/documentation/UIKit/UIFont/Weight)

Constants that represent standard typeface styles.

[`systemFont(ofSize:weight:width:)`](/documentation/UIKit/UIFont/systemFont(ofSize:weight:width:))

[`UIFont.Width`](/documentation/UIKit/UIFont/Width)

[`boldSystemFont(ofSize:)`](/documentation/UIKit/UIFont/boldSystemFont(ofSize:))

Returns the font object for standard interface items in boldface type in the specified size.

[`italicSystemFont(ofSize:)`](/documentation/UIKit/UIFont/italicSystemFont(ofSize:))

Returns the font object for standard interface items in italic type in the specified size.

[`monospacedSystemFont(ofSize:weight:)`](/documentation/UIKit/UIFont/monospacedSystemFont(ofSize:weight:))

Returns the fixed-width font for standard interface text in the specified size.

[`monospacedDigitSystemFont(ofSize:weight:)`](/documentation/UIKit/UIFont/monospacedDigitSystemFont(ofSize:weight:))

Returns the standard system font with all digits of consistent width.

### Getting the Available Font Names

[`familyNames`](/documentation/UIKit/UIFont/familyNames)

Returns an array of font family names available on the system.

[`fontNames(forFamilyName:)`](/documentation/UIKit/UIFont/fontNames(forFamilyName:))

Returns an array of font names available in a particular font family.

### Getting Font Name Attributes

[`familyName`](/documentation/UIKit/UIFont/familyName)

The font family name.

[`fontName`](/documentation/UIKit/UIFont/fontName)

The font face name.

### Getting Font Metrics

[`pointSize`](/documentation/UIKit/UIFont/pointSize)

The font’s point size, or the effective vertical point size for a font with a nonstandard matrix.

[`ascender`](/documentation/UIKit/UIFont/ascender)

The top y-coordinate, offset from the baseline, of the font’s longest ascender.

[`descender`](/documentation/UIKit/UIFont/descender)

The bottom y-coordinate, offset from the baseline, of the font’s longest descender.

[`leading`](/documentation/UIKit/UIFont/leading)

The font’s leading information.

[`capHeight`](/documentation/UIKit/UIFont/capHeight)

The font’s cap height information.

[`xHeight`](/documentation/UIKit/UIFont/xHeight)

The x-height of the font.

[`lineHeight`](/documentation/UIKit/UIFont/lineHeight)

The height, in points, of text lines.

### Getting System Font Information

[`labelFontSize`](/documentation/UIKit/UIFont/labelFontSize)

The standard font size, in points, for labels.

[`buttonFontSize`](/documentation/UIKit/UIFont/buttonFontSize)

The standard font size, in points, for buttons.

[`smallSystemFontSize`](/documentation/UIKit/UIFont/smallSystemFontSize)

The size, in points, of the standard small system font.

[`systemFontSize`](/documentation/UIKit/UIFont/systemFontSize)

The size, in points, of the standard system font.

### Getting Font Descriptors

[`fontDescriptor`](/documentation/UIKit/UIFont/fontDescriptor)

A font descriptor for the font.

[`UIFontDescriptor`](/documentation/UIKit/UIFontDescriptor)

A collection of attributes that describes a font.



---

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)