To apply them by code use the following snippet:
Typeface font = Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf"); textView.setTypeface(font);On the second part of this series we'll apply custom fonts in xml.
UPDATE: Oh, and please don't include unnecessary fonts in the asstes folder as seen above as it will bloat your apk. Thanks.
No comments:
Post a Comment