0

I want to use Google's Raleway font in my android app. I have read a lot of blogs and a number of answers on stackOverflow but haven't found the exact answer.

The best answer i found is here that explains to create custom TextViews efficiently.

If i have two use two variations of the font say Raleway-Regular and Raleway-SemiBold, do i have to create two custom TextViews or is there any better way to achieve that ?

Community
  • 1
  • 1
sanju
  • 113
  • 9

3 Answers3

1

I have done the task the following way Download the ttf of that font and then paste it inside the asset folder(you have to create the assets folder inside /src/main/assets) then change the font the following way:

Typeface face = Typeface.createFromAsset(getAssets(), "condenced.ttf"); tv_the.setTypeface(face);

you can download the multiple ttf files and can display the different fonts to different fields. Hope this helps.

Rakshit Nawani
  • 2,604
  • 14
  • 27
  • I want a solution that is application wide, in this case i'll have to set the typeface multiple times that is not acceptable. – sanju Mar 02 '16 at 13:32
0

I am using Calligraphy library for my project and it works perfect.

Amit Tiwari
  • 3,684
  • 6
  • 33
  • 75
0

For me the best way to use a custom font is this library: Calligraphy

kazhiu
  • 749
  • 9
  • 21