Author Topic: NGUI UILabel's Spacing does NOT work.  (Read 8153 times)

Bstar

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
NGUI UILabel's Spacing does NOT work.
« on: March 09, 2017, 03:02:16 AM »
Hello, I'm NGUI 3.11.2 and UNITY 5.4.4f1 user.

I want to use text using UILabel. But I can't use the letter spacing.

It works when negative number is specified, but if it is specified as a positive number,

it moves only by the corresponding number in front of the letter, it does not work.

How can I use it? Help me  :(

Thank you.

m32gunner

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #1 on: March 09, 2017, 07:59:42 AM »
Same here, I think it's NGUI's problem since it's not working on both Unity and NGUI fonts.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #2 on: March 10, 2017, 11:43:25 AM »
Hmm... that got broken at some point I guess. Simple one line fix. Line 1644 of NGUIText.cs -- change from:
  1. if (finalSpacingX < 0f) w += finalSpacingX;
to:
  1. w += finalSpacingX;

m32gunner

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #3 on: March 10, 2017, 10:54:26 PM »
Thank you! It worked perfectly. Have a great weekend, sir.

Bstar

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #4 on: March 12, 2017, 06:49:19 AM »
Thank you so much! It works perfectly  :) :) :)

justinISO

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 52
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #5 on: April 12, 2017, 11:58:20 AM »
So I made this fix and the spacing now works, however, now when it clamps the content, it drops the last character or two of the last word down to a second line.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #6 on: April 14, 2017, 04:07:21 PM »
Doesn't do that on my end, justin -- so I'll need a repro case showing how it breaks for you.

Tr0sT

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 1
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #7 on: April 26, 2017, 11:35:50 AM »
line 1015 of nguitext.cs (CalculatePrintedSize function):
change from:
  1. if (finalSpacingX < 0f) w += finalSpacingX;
to:
  1. w += finalSpacingX;

to fix problems with ResizeFreely, Clamp, etc

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI UILabel's Spacing does NOT work.
« Reply #8 on: April 28, 2017, 09:48:52 AM »
Guess I missed that one. Thanks, Tr0sT!