Better Programming

Advice for programmers.

Follow publication

Member-only story

How to Use Custom Fonts With Dynamic Type in iOS apps

Add a new font to your iOS app today

Kristaps Grinbergs
Better Programming
Published in
4 min readOct 12, 2020

--

Hand holding out phone
Photo by NeONBRAND on Unsplash.

A while back, we looked into Dynamic Type with the system font. This time, we are going to check out how to use Dynamic Type with a custom font in our iOS apps. Apple provides great APIs to make our apps accessible — even if we’re using custom font styles.

Add Custom Font to App

First, we need to add our custom font to the project. There are several steps involved, so let’s go over them.

We need to add a font file to the Xcode app project. Currently, True Type Font (.ttf) and Open Type Font (.otf) files are being supported. Just drag and drop files in your XCode project. Be careful and select targets you want to use this font in:

Adding font files in Xcode

If you forget to add the font to the specific target membership in your Xcode project, you will run into an issue when the font file is not found:

Fatal error in Xcode

--

--

Kristaps Grinbergs
Kristaps Grinbergs

Written by Kristaps Grinbergs

Blockchain, mobile and fullstack developer. Startup founder. Conference speaker. Mentor. Passionate about building products, sustainability and Web 3.0.

Responses (1)

Write a response