---
title: UIFont
framework: uikit
role: symbol
role_heading: Class
path: uikit/uifont
---

# UIFont

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

## Declaration

```swift
class UIFont
```

## Mentioned in

Adding a custom font to your app Scaling fonts automatically

## Overview

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, such as 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](uikit/scaling-fonts-automatically.md)
- [Creating self-sizing table view cells](uikit/creating-self-sizing-table-view-cells.md)
- [preferredFont(forTextStyle:)](uikit/uifont/preferredfont(fortextstyle:).md)
- [preferredFont(forTextStyle:compatibleWith:)](uikit/uifont/preferredfont(fortextstyle:compatiblewith:).md)
- [UIFont.TextStyle](uikit/uifont/textstyle.md)
- [init(name:size:)](uikit/uifont/init(name:size:).md)
- [init(descriptor:size:)](uikit/uifont/init(descriptor:size:).md)
- [withSize(_:)](uikit/uifont/withsize(_:).md)

### Creating System Fonts

- [systemFont(ofSize:)](uikit/uifont/systemfont(ofsize:).md)
- [systemFont(ofSize:weight:)](uikit/uifont/systemfont(ofsize:weight:).md)
- [UIFont.Weight](uikit/uifont/weight.md)
- [systemFont(ofSize:weight:width:)](uikit/uifont/systemfont(ofsize:weight:width:).md)
- [UIFont.Width](uikit/uifont/width.md)
- [boldSystemFont(ofSize:)](uikit/uifont/boldsystemfont(ofsize:).md)
- [italicSystemFont(ofSize:)](uikit/uifont/italicsystemfont(ofsize:).md)
- [monospacedSystemFont(ofSize:weight:)](uikit/uifont/monospacedsystemfont(ofsize:weight:).md)
- [monospacedDigitSystemFont(ofSize:weight:)](uikit/uifont/monospaceddigitsystemfont(ofsize:weight:).md)

### Getting the Available Font Names

- [familyNames](uikit/uifont/familynames.md)
- [fontNames(forFamilyName:)](uikit/uifont/fontnames(forfamilyname:).md)

### Getting Font Name Attributes

- [familyName](uikit/uifont/familyname.md)
- [fontName](uikit/uifont/fontname.md)

### Getting Font Metrics

- [pointSize](uikit/uifont/pointsize.md)
- [ascender](uikit/uifont/ascender.md)
- [descender](uikit/uifont/descender.md)
- [leading](uikit/uifont/leading.md)
- [capHeight](uikit/uifont/capheight.md)
- [xHeight](uikit/uifont/xheight.md)
- [lineHeight](uikit/uifont/lineheight.md)

### Getting System Font Information

- [labelFontSize](uikit/uifont/labelfontsize.md)
- [buttonFontSize](uikit/uifont/buttonfontsize.md)
- [smallSystemFontSize](uikit/uifont/smallsystemfontsize.md)
- [systemFontSize](uikit/uifont/systemfontsize.md)

### Getting Font Descriptors

- [fontDescriptor](uikit/uifont/fontdescriptor.md)
- [UIFontDescriptor](uikit/uifontdescriptor.md)

### Initializers

- [init(coder:)](uikit/uifont/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Fonts

- [Scaling fonts automatically](uikit/scaling-fonts-automatically.md)
- [Adding a custom font to your app](uikit/adding-a-custom-font-to-your-app.md)
- [UIFontDescriptor](uikit/uifontdescriptor.md)
- [UIFontDescriptor.SymbolicTraits](uikit/uifontdescriptor/symbolictraits-swift.struct.md)
- [UIFontMetrics](uikit/uifontmetrics.md)
