in ios it is not same as it in computer there is text:"ยินดี in computer is
but in ios it is
the fontsize is 16
I tried every font which is in ios and tried copy simsun in windows to ios and create CTFont I draw it using UIGraphics drawString
in ios it is not same as it in computer there is text:"ยินดี in computer is
but in ios it is
the fontsize is 16
I tried every font which is in ios and tried copy simsun in windows to ios and create CTFont I draw it using UIGraphics drawString
I do notice that the surrounding rectangle of the text on your "computer", which I'd assume a macOS system, doesn't quite as fit as the one on iOS. That may be related to the method you use to do text measurement, and is discussed a bit in the following post:
If the post doesn't help, you might want to provide the code, text, and font that can reproduce the issue – Without that, it's hard to provide meaningful comment.
If your concern is actually that the size of the text with a same font looks different between macOS and iOS, it may be related to text scaling, as discussed in this WWDC session: Font Management and Text Scaling.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.
I am not using textView but using UIGraphics to drawString and save it as png UIGraphicsBeginImageContext(CGSize(300,60)); var gra=UIGraphicsGetCurrentContext(); and then use NSAttribtedString to drawString
OK, what is the problem then? Is it that the surrounding rectangle of the text on iOS is different from that on macOS, or is it that the text looks different?
I thought it was the former, but by looking into the screenshots carefully, I do see that the character shape is different, and I believe that is because, when rendering the text, iOS and macOS fall back to a different font.
The font fallback happens when the text rendering engine hits a character that is not covered in the specified font. To avoid using fallback fonts, you need to make sure that the font you use contains the glyphs of the characters you would render. I don't know the language and have no idea about what font you can use though.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.