Using Custom Font Family in Xamarin Forms

Dinesh Falwadiya
3 min readMar 6, 2022

Ever wondered how to use a custom font family for your App Label, Button, Entry, etc? In this article, we will learn how to use a cool custom font family & make our App UI more attractive & cool. I will be using Google Fonts for this article.

Awesome Font
Awesome Font

Let’s divide the process into 4 steps given below

  1. Choose your favorite google font from here and download the font zip.
  2. Add the font .tff file to respective platform folders
  3. Finally, the code to make the magic work.

1. Download Google Font

You can choose any font family from the Awesome Google Font library and download the family.

Choose Font Family
Download family

2. Add Font Family

Now let’s add the downloaded font family into our platform-specific folders for Android & iOS.

Android → Add the .tff file into the Assets folder of the Android Project & make sure the Build Action of those files are set to AndroidAsset. Right-click on the font-family file & select Properties to view the Build Action.

Assets Folder
Android Build Action

iOS → Add the .tff file into the Resources folder of the iOS Project & make sure the Build Action of those files are set to BundleResource. Right-click on the font-family file & select Properties to view the Build Action.

iOS Resources
iOS Build Action

3. Let’s Code

We will be creating a ContentPage that will have a Label & 2 Buttons to switch from one font family to other.

Font Resource File

Let’s create a separate static class that will have the font family definition defined.

Font Definition

CustomFontPage Xaml Code

CustomFontPage Code Behind

That’s it our custom font family implementations are done. Do let me know what other topics should I cover next.

--

--

Dinesh Falwadiya

Mobile app developer who loves to share his knowledge and get improve with others.