I was looking for some stylish fonts for my android application. but the problem is how can i make my android application supportable for external fonts.
Thank you.
I was looking for some stylish fonts for my android application. but the problem is how can i make my android application supportable for external fonts.
Thank you.
You can use the custom TextView for whole app with custom font here is an example for that
To implement you need use Typeface go through with sample below
One more point in addition to the above answers. When using a font inside a fragment, the typeface instantiation should be done in the onAttach method ( override ) as given below:
Reason:
There is a short span of time before a fragment is attached to an activity. If CreateFromAsset method is called before attaching fragment to an activity an error occurs.
Create a folder named fonts in the assets folder and add the snippet from the below link.
I recommend this approach it very nice with adding name of custom font in
typeface
tostyles.xml
and putting your set of fonts intoassets
folder.You need to create fonts folder under assets folder in your project and put your TTF into it. Then in your Activity onCreate()
Please note that not all TTF will work. While I was experimenting, it worked just for a subset (on Windows the ones whose name is written in small caps).