Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.15.0, 6.8.3, 6.9.0
Description
With QML Types such as Text, TextEdit and Label , when the "wrapMode" property is set to "TextEdit.WordWrap" and it holds a text longer than the object's width, it tries to display the text with wrapping it on word boundaries only.
This works well for languages where word boundaries are easy to find, e.g. English. However, for other laguages where word boundaries are difficult to find e.g. Japanese language, the wrapping on word boundaries does not work. That seems inavoidable due to the nature of the languages.
To provide a solution for that issue, this ticket suggests to add a support for <wbr> tags in QML Types with limited HTML tags support, such as Text, TextEdit, Label, etc.
Here is the description of <wbr> tag from MDN Web Docs:
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/wbr
The <wbr> HTML element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location.
Attached application reproduces the issue with Japanese language.
The original english text is "This is a veryveryveryveryverylongword", and this is displayed like below.
The line break is in between "This is a" and "veryveryveryveryverylongword" as expected :
This is a veryveryveryveryverylongword
The translated Japanese text is as below. The line break comes at the right edge of the window, regardless of word boundaries.
これは1つのとてもとてもとてもとてもとても長い単語