Changing Font in the Application

Updated 14 December 2016

Save

We are often interested in the personalisation. When it comes to our desktop theme we reflect our taste. Same thing happens in case of application theming. We change style, fonts, colors, animation and like that. Changing font is also as important as other theming elements.

I was recently tasked with adding the ability to change font size when user changes the store.

Today we are gonna change the default theme of the application.

1. Custom Font Files

We can download free fonts available
banner(2)
e.g. https://www.google.com/get/noto/#kufi-arab 

2. Adding Font Files Applications

Remove the files from the .zip folder   assets /fonts under-copy.

For grade build the path will look like:

Screenshot_1

 

If you mistakenly choose different path, you will issues like

 

 3. Using the application elements on the Font File

First of all extends the Application and override the on Create Methods.

Hot Served Code for FontsOverride class:

 

Another way to achieve it is by using Custom Class.

Create a custom class

Now you can access this custom UI wherever we want. We can access it directly in XML or programmatically.

 

 

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


1 comments

  • Aman Gupta
  • Start a Project


      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home