I applied a custom font to TextView. But… I don't think my handwriting is changing properly. This is my code below.
Typeface myTypeface = Typeface.createFromAsset(getAssets(), "fonts/myFont.ttf");
TextView myTextView = (TextView)findViewById(R.id.myTextView);
myTextView.setTypeface(myTypeface);
Please solve this problem.
android custom-font android-fonts android-typeface
If you go to Mobiletuts, there is a good tutorial for converting text in an Android environment Quick Tip: Customize Android Fonts.
I just tested it myself and I'll tell you how. Create a subfolder named fonts inside the assets folder. Be careful not to make it a subfolder of the res folder. Then it's going to be like this, right?
assets/fonts
And the extension of the font file must be lowercase. It's not myFont.TTF, but myFont.ttf.
© 2024 OneMinuteCode. All rights reserved.