Author Topic: Special Characters Break Text Wrapping [Solved]  (Read 562 times)

stc105

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Special Characters Break Text Wrapping [Solved]
« 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.
« Last Edit: March 30, 2018, 10:11:33 AM by stc105 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,151
  • Toronto, Canada
    • View Profile
Re: Special Characters Break Text Wrapping
« Reply #1 on: March 29, 2018, 12:02:08 PM »
You really should be using emoticons instead.

stc105

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Special Characters Break Text Wrapping
« Reply #2 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

  1. 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.