When textOverrun is set to (any) ellipsis, and the text contains grapheme clusters, the code in Utils.computeClipped* methods breaks grapheme clusters (see the screenshots).
Steps to reproduce:
- use the updated MT https://github.com/andy-goryachev-oracle/MonkeyTest
- set text: emojis
- set wrap text off
- set text overrun to either CENTER_ELLIPSIS, CENTER_WORD_ELLIPSIS, LEADING_ELLIPSIS, LEADING_WORD_ELLIPSIS, or WORD_ELLIPSIS. (Curiously, ELLIPSIS works fine)
- make sure Region properties (min/max/pref) (width/height) are set to USE_COMPUTED_SIZE
- resize the viewport to truncate the label text.
The truncation algorithm does not take into account grapheme clusters (where a glyph consists of more that one character), inserting the ellipsis string in the middle of the cluster, breaking it. As a result, various weird characters appear next to the ellipsis string.
References:
LabeledSkinBase:1105
Utils.computeClippedWrappedText()
Utils.computeClippedText()
Steps to reproduce:
- use the updated MT https://github.com/andy-goryachev-oracle/MonkeyTest
- set text: emojis
- set wrap text off
- set text overrun to either CENTER_ELLIPSIS, CENTER_WORD_ELLIPSIS, LEADING_ELLIPSIS, LEADING_WORD_ELLIPSIS, or WORD_ELLIPSIS. (Curiously, ELLIPSIS works fine)
- make sure Region properties (min/max/pref) (width/height) are set to USE_COMPUTED_SIZE
- resize the viewport to truncate the label text.
The truncation algorithm does not take into account grapheme clusters (where a glyph consists of more that one character), inserting the ellipsis string in the middle of the cluster, breaking it. As a result, various weird characters appear next to the ellipsis string.
References:
LabeledSkinBase:1105
Utils.computeClippedWrappedText()
Utils.computeClippedText()
- relates to
-
JDK-8365801 Broken clusters in Khmer
-
- Open
-