11

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.

Sunil Sunny
  • 3,949
  • 4
  • 23
  • 53

3 Answers3

22

re-convert your whatever fonts to .ttf from this link works for me.

http://www.freefontconverter.com/

AstonCheah
  • 246
  • 3
  • 7
  • Thanks it's working ...but a small issue my font was 44.3 kb but after conversion it's 23.3 kb however didn't noticed any issues with the font so I am accepting this as answer. – Sunil Sunny May 05 '15 at 10:35
  • 2
    Awesome! I had a font (.ttf) that was ignored by Android. No errors were thrown, but the text rendered in the default Android font. I ran my font file through this converter (redundantly converting it from .ttf to .ttf) and it now works! – Shadoninja Jan 26 '16 at 04:44
  • 1
    thank you, your idea is useful for me. In my case, I use this converter https://onlinefontconverter.com/ and it's work. – danisupr4 Mar 03 '16 at 07:24
  • We were also about to use FontCreator to export the .ttf as .ttf and it fixed the issue of Android ignoring our font as well. It'd be really nice to know what it fixed to let Android see it. – Millec8 Apr 26 '17 at 16:46
4

I did it in following way:

I have updated TextView with androidx.appcompat.widget.AppCompatTextViewand it works for each device.

Example

From

 <TextView

To

 <androidx.appcompat.widget.AppCompatTextView

Hope it helps you.

Hiren Patel
  • 52,124
  • 21
  • 173
  • 151
1

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

http://www.font2web.com/

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

Alex Zaraos
  • 6,443
  • 2
  • 26
  • 21