Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle height of Thai text in UILabel?

I’m working on an application we’re currently translating to Thai. Everything went smoothly when we tested the app on iOS 7, but on iOS 8, some accents were clipped by UILabels.

We’re using Auto-Layout to layout all of the elements of the application.

I’ve read somewhere in the release notes of iOS 8 that the Thai characters default font has been increased for enhanced readability. However, Auto-Layout does not seem to care and leave the height of the label as if it was displaying latin text, thus leading to some accent being clipped.

What is the proper way to handle Thai text in iOS?

EDIT: Here’s a picture showing the problem. (OK is on iOS 7, CUT is on iOS 8.)

The problem is shown in this image

Note: I tried setting the clipToBounds property of the UILabel to NO, the text is not clipped indeed. However this is not a good solution! If I have two labels one above the other, I may have overlapping texts…

like image 694
Frizlab Avatar asked Nov 22 '22 02:11

Frizlab


1 Answers

Just would like to mention that this issue still exists on iOS 14, tested with iPhone 11 Pro.

line height issue

With lineHeight set:

line height issue

like image 127
Simon Avatar answered Nov 23 '22 18:11

Simon