Android: Fix for TextView.setTypeFace() not working on Android 5.x+ (Lollipop/Marshmallow)

This is one of the latest quirks I've had the displeasure of running into while upgrading an old app to the latest Android 6/Marshmallow.

The problem happens when the font fails to apply onto a TextView even though it loaded via Typeface.createFromAsset() without any errors.

Because I haven't worked on this app in many years, the problem has gone unnoticed until now.

Fortunately it's quite an easy fix and there is no need to change any code. What you actually have to do is pass the font file through the converter at http://www.freefontconverter.com and update the font file.

Easy. So, so easy.

Sources

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog