Stats

108 Contributors: 3
Tuesday, August 8, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Enhancing Android Performance Using Icon Fonts

Download android eBook

Remarks

Icon Fonts are like normal font types that have symbols instead of letters. It can be used in your application with at-most ease.

They are:

  • Flexible
  • Scalable
  • Vectors
  • Fast Processable
  • Light Weight
  • Accessible

Effect on Size

Exporting an image in various sizes for android devices would cost your app, additional asset size of around 30kB per image. While adding a font file(.ttf) with around 36 icons would cost just 9kB. Just imagine the case if you are adding 36 individual files of various configurations it would be around 1000kB. It’s a reasonable amount of space that you will save by using icon fonts.

Limitations of Icon fonts.

  • Icon fonts can be used in navigation drawer. Using them in navigation views as icon of menu items is not possible as the menu file cannot be created without specifying the title. So it is advisable to use svg files as resources for these icons.

  • Icon fonts cannot be used in floating action button. as they does not have a setText() attribute.

  • External fonts cannot be applied from xml. They must be specified using the java file. Or else you need to extend the basic view and create a view as specified in this post

Related Examples