<!--
{
  "documentType" : "article",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/adding-a-custom-font-to-your-app",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Adding a custom font to your app"
}
-->

# Adding a custom font to your app

Add a custom font to your app and use it in your app’s interface.

## Discussion

Your app isn’t limited to the custom fonts provided by iOS. If your company has its own branded font, for example, you can use it in your app. Add the font file that contains your font to your app bundle, then use your font the same way you use any of the iOS-provided custom fonts.

### Add the font file to your Xcode project

To add a font file to your Xcode project, select *File > Add Files to “Your Project Name”* from the menu bar, or drag the file from Finder and drop it into your Xcode project. You can add True Type Font (.ttf) and Open Type Font (.otf) files.

![A screenshot of the Project Navigator showing the custom font files added to the CustomFont project.](images/com.apple.uikit/adding-a-custom-font-to-your-app-1@2x.png)

Also, make sure the font file is a target member of your app; otherwise, the project will not distribute the font file as part of your app.

![A screenshot of the File Inspector showing that the selected font file is a member of the CustomFont target.](images/com.apple.uikit/adding-a-custom-font-to-your-app-2~dark@2x.png)

### Register your font file with iOS

After adding the font file to your project, you need to let iOS know about the font. To do this, add the key “Fonts provided by application” to the information property list (the raw key name is `UIAppFonts`). Xcode creates an array value for the key; add the names of each font file as items of the array. Be sure to include the file extension as part of the name.

![Screenshot of Xcode showing the contents of the Info.plist file. The 'Fonts provided by application' key contains the filenames of two font files.](images/com.apple.uikit/adding-a-custom-font-to-your-app-3@2x.png)

Include each font file you add to your project in this array; otherwise, the font will not be available to your app.

### Use your custom font in Interface Builder

After you add the font file to your Xcode project and its *Info.plist*, you can begin assigning the font to UI objects like [`UILabel`](/documentation/UIKit/UILabel) and [`UITextField`](/documentation/UIKit/UITextField). If you’re using Interface Builder, assign the UI object’s *Font* setting to your custom font using the Attribute Inspector.

![Screenshot of Interface Builder showing that the font for the label is 'CustomFont 17.0.'](images/com.apple.uikit/adding-a-custom-font-to-your-app-4@2x.png)

### Use your custom font in source code

You can create an instance of your custom font in source code. To do this, you need to know the font name.  However, the name of the font isn’t always obvious, and rarely matches the font file name. A quick way to find the font name is to get the list of fonts available to your app, which you can do with the following code:

```swift
for family in UIFont.familyNames.sorted() {
    let names = UIFont.fontNames(forFamilyName: family)
    print("Family: \(family) Font names: \(names)")
}
```

Once you know the font name, create an instance of the custom font using [`UIFont`](/documentation/UIKit/UIFont). If your app supports Dynamic Type, you can also get a scaled instance of your font, as shown here:

```swift
guard let customFont = UIFont(name: "CustomFont-Light", size: UIFont.labelFontSize) else {
    fatalError("""
        Failed to load the "CustomFont-Light" font.
        Make sure the font file is included in the project and the font name is spelled correctly.
        """
    )
}
label.font = UIFontMetrics.default.scaledFont(for: customFont)
label.adjustsFontForContentSizeCategory = true
```

For more information on using scaled fonts, see [Scaling fonts automatically](/documentation/UIKit/scaling-fonts-automatically).

---

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)