4
votes

I am having an issue with wrapping text in a QML Text element for international language such as korean .

Text {
    text: "안녕하세요 반갑습니다"
    width: 100
    wrapMode: Text.WordWrap
}

If I run this code, the text is displayed like this:

안녕하세요 반갑습
니다.

As you can see, the line breaks at the end of the third character of the second word. However, what I want is to break into a new line at the end of a word, not in the middle of a word. The proper output should be like this:

안녕하세요 
반갑습니다.

Is there any way to solve this out? I am currently using Qt 5.1.1.

1
I've already seen that post. I am not considering to use WebView element. - sam

1 Answers

3
votes

Read Unicode documentation about word bouderies. This behavior is proper (there is Korean-English example). Read this carefully maybe you will find satisfying solution.

In Unicode there is spatial character WJ (Word Joiner). You can use this to fix it.

This also (JL) looks interesting (Korean Korean syllable blocks).