Is it possible to set a custom font for entire of application?

后端 未结 25 2659
日久生厌
日久生厌 2020-11-22 02:44

I need to use certain font for my entire application. I have .ttf file for the same. Is it possible to set this as default font, at application start up and then use it else

25条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 03:07

    Calligraphy works pretty well, but it is not suitable for me, since it does not support different weights (bold, italic, etc) for a font-family.

    So I tried Fontain, which allows you to define custom Views and apply them custom font families.

    in order to use Fontain, you should add the following to your app module build.gradle:

    compile 'com.scopely:fontain:1.0.0'
    

    Then, instead of using regular TextView, you should use FontTextView

    Example of FontTextView with uppercase and bold content:

     
    

提交回复
热议问题