Custom ttf fonts are not showing properly in TextView on Android 4.4 KitKat

后端 未结 5 1121
忘掉有多难
忘掉有多难 2020-12-19 04:06

I have some text which has some bolded parts. Until KitKat this strategy (as mentioned in this post) worked perfectly well

My strings resources file:



        
5条回答
  •  死守一世寂寞
    2020-12-19 04:20

    So, after being frustrated by this bug, I searched around and found a solution to the problem. In my current project we use calibri.ttf font. that was working fine up to 4.4. Once i got the update to my nexus 4, All the TextViews with Calibri font were showing "ff" instead of the entire text.

    THE FIX - get an .otf (open type font) version of your font, and put in the project, works like a charm. Too bad google didn't inform the developers on this and there's very little documentation on the matter.

提交回复
热议问题