Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions ui/text/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,18 @@ bool IsSpace(QChar ch) {
|| (ch == QChar::LineSeparator)
|| (ch == QChar::ObjectReplacementCharacter)
|| (ch == QChar::CarriageReturn)
|| (ch == QChar::Tabulation);
|| (ch == QChar::Tabulation)
|| (ch == QChar::ByteOrderMark)
|| (ch == QChar(8203)) // zero width space
|| (ch == QChar(0x200C)) // zero width non-joiner
|| (ch == QChar(0x200D)) // zero width joiner
|| (ch == QChar(0x2060)) // word joiner
|| (ch == QChar(0x1160)) // hangul jungseong filler
|| (ch == QChar(0x3164)) // hangul filler
|| (ch == QChar(0xFFA0)) // halfwidth hangul filler
|| (ch == QChar(0x17B4)) // khmer vowel inherent aq
|| (ch == QChar(0x17B5)) // khmer vowel inherent aa
|| (ch == QChar(0x2800));// braille pattern blank
Comment on lines +2333 to +2342

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it's going to break lots of language scripts

}

bool IsDiacritic(QChar ch) { // diacritic and variation selectors
Expand Down Expand Up @@ -2357,8 +2368,7 @@ bool IsReplacedBySpace(QChar ch) {

bool IsTrimmed(QChar ch) {
return ((ch != QChar::ObjectReplacementCharacter) && IsSpace(ch))
|| IsBad(ch)
|| (ch == QChar(8203)); // zero width space
|| IsBad(ch);
}

QSize CountOptimalTextSize(
Expand Down