HI All
I am using TMP with chinese, and the wrapping is not my expect
right now I through RichText \n to make it
have any smarter way?
HI All
I am using TMP with chinese, and the wrapping is not my expect
right now I through RichText \n to make it
have any smarter way?
plus
Line breaking for Chinese, Japanese and Korean is based on the Leading and Following Character rules which define where it is legal to break a line of text. The list of leading and following characters is defined in the TMP Settings which can be edited.
Based on the above rules, the text would break after âćâ since this character is allowed to be at the end of a line. Since the series of ârrrrrrrrâ are considered a word (Latin text), the word wraps to the next line. Since the whole word (ârrrrrrâ) doesnât fit on the 2nd line, we then have to break the word which is why the last ârâ is on the third line.
As you have shown in your image, the text breaks as follows:
Here is the same text in Microsoft Word.
As you can see, TMP breaks the text exactly as it does in Microsoft Word and other text processors / editing tools.
Having said that, you can prevent the text from breaking between the word âChineseâ and the series of ârâ by using the or no break tag as seen below:
âä¸ćrrrrrrrrrrrâ
WOW amazing!
I didnât know before it able Line breaking rules
is working for me ,thanks a lot!
how to avoid any line breaking? for example : rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
it still breaks at space position and get a result :
how to stop any line breaking???
Given the following text: âAB CDEF GHâ
We get the following on a single line.
Then once we can no longer fit everything on a single line, we break on the as seen below.
Then as we can no longer fit any of the no break groups on a single line, we actually break where it is legal which is at the space between AB and CD.
If we were to further reduce the width of the text container, we would then break between EF and GH. Then pass that point, we begin breaking on individual characters.
So in your example with all those ârâ since we can no longer respect the no break, we break on those spaces between the sequences of "r"s.
Now if we had the following text:
âAAAABBBBCCCCâ
Would we expect the text to break on the last C or to break at those if again we could no longer respect the no break?
What is the use case for breaking those individual ârâ or breaking on the last C above?
I can certainly rationalize breaking on the last C given we added those in the example above. But in the case of those ârâ and given the text does contain logical breaks (spaces) it would seem logical to respect those when we can no longer respect the no break. ThoughtsâŚ
Thank you, in some cases, I donât want to wrap the whole word,
but only part of the word. for example:
got:
what i expected is :
In your 2nd example, is that text enclosed in tags or do you expect it to not break on the white space between âg hâ?
what is expected is like: https://discussions.unity.com/t/765309/3
https://discussions.unity.com/t/756186/8
abcdefg hijkl has no effect, âhijklâ still breaks to next line.
Correct. As per one of my previous posts, when the text enclosed in the tag can no longer fit on a single line, we then break the text using logical break points which are typically white spaces. When this is no longer possible, we then break individual words.
My previous post to you was a question about whether or not your example was using the tag which it appears it was.
I am not opposed to adding additional line breaking modes, I am just trying to get a clear understanding of the use case to make sure these new modes achieve the desired result. So back to one of my previous questions:
In the current releases of the TMP package, If the text was âabcdefg hijklâ where the width of the text container is such that the entire text doesnât fit on a single line, we would break on the space between âgâ and âhâ.
However, if the text was âabcdefghijklâ where we would then break on the âkâ as per your example, would that be acceptable?
The key difference here is having to use the non-breaking space to indicate that we do not want to break between these two words.
P.S. I made the change where using a will force breaking per character as described above.
In this first example, the text is âAB CD EF GWâ resulting âCD EFâ wrapping as a single word and then between âCDâ and âEFâ when we are forced to break it. This is the current behavior.
In this 2nd example, we revise the text as follows: âAB CDEF GWâ to use to force breaking âCD EFâ per character when it no longer fits on a single line.
Character content is uncertainďźso itâs hard to add , if there is a checkbox to control character wrapping, that will be very convenient.
yeah, encountered the same problem. if there is a wrapping mode, that will be better.