Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom font with diacritic - different font on same signs on Android 7

I have a problem with custom font in my app. Sometimes it works, sometimes not.

I have ViewPager with fragments. In fragment 2 I have LinearLayout with programmatically added TextViews. Same TextView layout added many times. On first TextView everything works fine, but on others it have problem with diacritic signs.

enter image description here

For custom fonts I use Calligraphy, but I also tried to use font family from Support Library 26 with same result. TextViews should use default font, but again when I change font in style or set typeface programmatically I end up with same result.

The problem occurs only on Android 7 (tested on Nexus 5X, Huawei P10 Lite). On Samsung Galaxy S4, Huawei Mate 10 pro - everything works fine.

like image 316
Artur Latoszewski Avatar asked May 18 '18 09:05

Artur Latoszewski


1 Answers

I found the solution. The problem was with the text itself, not with the views. The exact reason was the characters encoding. This diacritic signs wasn't in proper encoding. However it is still strange that problem occurs only on one Android version. Same text was also used on iOS, and there everything was fine.

like image 111
Artur Latoszewski Avatar answered Oct 19 '22 09:10

Artur Latoszewski