Support => NGUI 3 Support => Topic started by: stc105 on March 28, 2018, 11:11:48 PM
Title: Special Characters Break Text Wrapping [Solved]
Post by: stc105 on March 28, 2018, 11:11:48 PM
Using special characters from a font like FontAwesome (see https://fontawesome.com/v4.7.0/) will cause the text wrapping to break on UILabel.
I'll look into why later - if ArenMook doesn't look into it.
Title: Re: Special Characters Break Text Wrapping
Post by: ArenMook on March 29, 2018, 12:02:08 PM
You really should be using emoticons instead.
Title: Re: Special Characters Break Text Wrapping
Post by: stc105 on March 30, 2018, 10:10:30 AM
Nope. I'm all about the font.
Anyway, I figured out the issue. Because Font Awesome has a ton of glyphs, the ch numbers can get into the tens of thousands. Because of that, the ch will accidentally be flagged as eastern.
See line 1202 in NGUIText
if(ch >12287) eastern =true;
Problem with this line of code, is it assumes the user is using a specific font what follows the average standards, which Font Awesome does not.
Since I wont be using eastern characters, this was an easy fix for me.