dinesh707 dinesh707 - 3 months ago 12
Android Question

Where should I put the "ttf" files in an Android project?

I'm trying to use fonts in my project using Typeface. I copied the

"font.ttf"
into a folder named "fonts" inside "assets" folder. But eclipse do not allow to compile it. It shows an error on fonts folder. What should I do?

The error I get is:

invalid resource directory name fonts /NoRats/assets line 1 Android AAPT Problem

Answer

Please check this link my be helpful to you


OR


used Below Code.

Typeface tf = Typeface.createFromAsset(this.getAssets(),
            "fonts/LATINWD.TTF");
    txt1.setTypeface(tf);

ttf file is in --> assets/fonts/LATINWD.TTF

Please first Clean your project then check again.

Happy Coding..