News We Recently Launched AD Migrator and AD Reporter.

How Can I Apply Custom Fonts in My Apple Watch App?

  author
Written By Chirag Arora  
Anuraag Singh
Approved By Anuraag Singh 
Published On October 27th, 2022
Reading Time 3 Minutes Reading

Apple watch custom font by Apple Watch apps with desired Fonts might be the next innovative thing you want to do. Who doesn’t like to do changes with technology especially when you have the latest Apple Watch! Unfortunately Xcode offers very few types of Fonts to create Apple Watch apps. And if users want to try some new Fonts, they will have to add them manually to project. This can be done by changing Font through code. This blog will elaborate entire procedure to perform this change in project.

 

Steps for Changing Font

It is important to have the .otf file for apple watch custom font. Here we will use KaushanScript font.

 

image003

 

Now, open the Xcode project to which you want to add font. Right-click on WatchKit Extension and select Add Files to option.

image005

Select new font and check the option of “Copy Items If Needed”. Also check the demo WatchKit extension and demo WatchKit App options before you import this new Font to project.

 

image007

 

Now select Project Name>> WatchKit Extension>> Build Phases >> Copy Bundle Resources making sure that bundle includes the Font.

 

image009

 

Now add the Fonts provided by application entry to plist file belonging to both WatchKit Extension and WatchKit App. For Item 0, set it to name of font file you want to ass with extension.

 

image011

 

To set  font afterwards, actual font name is required. The actual font name can be fetched from InterfaceController.swift file of initial view which comes under WatchKit extension and call printFonts method in awakeWithContext.

image013

Now Launch Watch app and in debug area find the font name. As soon as you get the name, you can remove the printFonts method from swift file.

image015

Switch to initial view of watch app and add a label to it. Now, connect it to the code using IBOutlet.

image017

Now create NSAttributedString instance with parameters as shown in image and then call setAttributedText (attributedText) to finally change the apple watch  font Choose the Font name and size carefully.

image019

When you will launch the App again, new Font will be visible.

image021

In order to accommodate the procedure one must be aware with different coding set with Xcode. It is undoubtedly a radical way of designing your Apple apps with completely new design. But it is important to perform the whole setting carefully. A customized desired Font for your Apple watch can immediately enhance your watch and can give it a complete new look.

  author

By Chirag Arora

Chirag Arora is a seasoned professional who wears multiple hats in the digital realm. As a Digital Marketing Manager, he orchestrates successful online campaigns, optimizing brand visibility and engagement. Additionally, Chirag brings meticulous attention to detail to his role as a Content Proofreader, ensuring that every piece of content shines with accuracy and clarity.