Hi,
We've got a couple of questions related to UILabel and Text wrapping:
1) If we add line breaks to text in a UILabel where:
- maxLines is 2
- overflow is Shrink Content
Then the text won't shrink to fit, and text will be cut-off. However, Reset maxLines to 0 and the text scales to fit as expected.
Is this a bug or a known limitation with NGUI 3.8.1?
2) The line breaking algorithm is currently "greedy" and our client would like more balanced lines, like what you'd get from a "Minimum Raggedness" algorithm
http://en.wikipedia.org/wiki/Line_wrap_and_word_wrap#Minimum_raggednessIt's highlighted best with 2 line UILabels we use in a store menu to display descriptions for the items. Because it is greedy, it will try to fill the first line, even if the second line only has one word (or in Eastern languages, it will often put punctuation on a new line by itself).
We tried a workaround of adding new lines into the text before putting it in the label, but because of the first issue I mentioned, we lose scaling, and so longer text would get cut-off.
So currently I have modified UILabel to use our custom text wrap function.
My question is:
Are there any plans to expand on the functionality here?
- Adding a minimum raggedness algorithm would be great!
- Implementing more rules line breaking with Asian Lanugages would be a cheeky bonus to stop punctuation spilling onto other lines - although this issue is much less prevalent when not using a greedy algorithm.
https://msdn.microsoft.com/en-us/goglobal/bb688158.aspxAnd if not, (languages are a big complex monster) it would be great for us if text wrapping in NGUI was extensible, so we can modify it to work best for us without having to apply patches to NGUI. As we have many projects that would share this.