3

I'm using customized fonts in my android app, specifically using Typeface This works fine!

Typeface customFont = Typeface.createFromAsset (getAssets (), "fonts / myfont.ttf"); 
myTextView.setTypeface (customFont); 
myTextView.setText ("Hello"); 

The problem is that it works on all versions except android L, simply does not change the font.

I have been reviewing the documentation but, although it is mentioned that the default font is new, can not find anything that explains this.

Can anyone help me with this?

Thanks and regards.

Sergio76
  • 3,835
  • 16
  • 61
  • 88
  • Try getting rid of the spaces in your path. – CommonsWare Jul 07 '14 at 11:12
  • Hi, there are no spaces in the path. They have appeared to copy the code in this web. An "android L" is the only version which does not work. – Sergio76 Jul 07 '14 at 11:19
  • 1
    Create a sample project that reproduces the problem and file an issue on the dedicated android-L issue tracker. – CommonsWare Jul 07 '14 at 11:20
  • Android L is still in "Preview" release mode, so expect it to have many problems. I wouldn't rush to support this release yet until Google has ironed out some of the major defects. – ChuongPham Jul 07 '14 at 12:27
  • Issue reported: https://code.google.com/p/android-developer-preview/issues/detail?id=608&thanks=608&ts=1404735239 – Sergio76 Jul 07 '14 at 15:24

1 Answers1

0

Surprisingly, Google did not fix this issue in Android 5.0 (API 21), so much for a pre release build. This is not an issue in Android 5.1 (API 22) however. I have posted a work around for Android 5.0 here, and it is quite simple: https://stackoverflow.com/a/29584570/1839500

Community
  • 1
  • 1
Dick Lucas
  • 12,289
  • 14
  • 49
  • 76