Reputation: 3994
I have developed a handwriting app .And one of the main feature of this is that we can change the fonts from default font to 4 other custom fonts ie, to
Vicmorg (Vic Modern Cursive)
Cursive Writing 7
Dnealiancursive
Print-Regular
And this is working fine in all devices.Yesterday I updated my nexus 10 to lollipop .Now the fonts are not taken correctly, vicmorg.ttf and Dnealiancursive.ttf are now not working but Print-Regular and Cursive Writing 7 are working .No issues in other phones though. Is there a fix for this ? Please help.
Upvotes: 11
Views: 15198
Reputation: 52800
I did it in following way:
I have updated TextView
with androidx.appcompat.widget.AppCompatTextView
and it works for each device.
From
<TextView
To
<androidx.appcompat.widget.AppCompatTextView
Hope it helps you.
Upvotes: 4
Reputation: 6553
Error on lollipoop
test files .otf run correctly but .ttf not. my solution for files .ttf was convert to .otf
http://www.files-conversion.com/font-converter.php
or
for custom font for example, inside assets folder (../assets/fonts/birdman-webfont.otf):
Typeface birdman = Typeface.createFromAsset(getAssets(), "fonts/birdman-webfont.ttf");
TextView text= (TextView) findViewById(R.id.text);
text.setTypeface(birdman);
note: if your file is .ttf and show ERROR in the convertion, change the extension to .otf manually and convert with http://www.files-conversion.com/font-converter.php
Upvotes: 1
Reputation: 246
re-convert your whatever fonts to .ttf from this link works for me.
http://www.freefontconverter.com/
Upvotes: 22