Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Dalediko on June 18, 2014, 09:49:10 AM

Title: Word wrapping in UILabel breaks at last character
Post by: Dalediko on June 18, 2014, 09:49:10 AM
Hey everyone,

I've been struggling with this for a while. Found some posts here on similar issues, but none of them solved my prob.
We're using NGUI 3.6.1, developing an app for mobile (Android & iOS) which contains tons of dynamic texts.
Our customer is in Germany, meaning... lots of long German words :-)

On multiline UILabels with "ResizeHeight", when the last word in the line is just a bit too long, sometimes the last character
is broken into a new separate line.
It doesn't even "join" the following line - it's much worse - the last character appears in a separate line of its own,
then another line break, and only then the rest of the text continues...

I've tried to dig into the UILabel code and NGUIText.WrapText(), but gave up pretty quickly :-)
Maybe someone has already found a solution for this?

TNX

Daled.

BTW, I'm using bitmap fonts
Title: Re: Word wrapping in UILabel breaks at last character
Post by: Yukichu on June 18, 2014, 11:32:46 AM
I had issues where if I had two spaces between the end/start of sentences, I'd get the same issue sometimes (not all the time).

Not sure if it's related, but worth a check.  I just remember to use a single space between sentences now.
Title: Re: Word wrapping in UILabel breaks at last character
Post by: ArenMook on June 18, 2014, 04:35:45 PM
I'm not sure what this would be caused by, but if you can create a repro case for me, I'd love to have a look.
Title: Re: Word wrapping in UILabel breaks at last character
Post by: kittikun on August 21, 2014, 10:22:35 PM
I am experiencing a similar bug with the following setup on 3.7.0

label set to resize freely with all anchors set except the left one, so it expanding on the left as expected.

Sometimes, when add characters to the text, a new line will be added for the last characters
Title: Re: Word wrapping in UILabel breaks at last character
Post by: ArenMook on August 22, 2014, 03:56:00 AM
I looked into this and fixed it yesterday. Repro cases are a wonderful thing. :P