diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-01-12 13:09:40 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-01-12 23:34:08 +0900 |
| commit | b559abe7220b3d86edc427bcbf7db26f9f6f62d6 (patch) | |
| tree | 83c6a8a483f629d23d12d93f210379f5c51281f4 /src/kernel/qpainter.cpp | |
| parent | 1c9111b3795a3b87254cbac172dcc565c7f76a57 (diff) | |
| download | tqt-b559abe7.tar.gz tqt-b559abe7.zip | |
Add support for Unicode surrogate characters and planes above zero.
If the selected font supports the required characters, the text will be displayed correctly.
If the selected font does not support such characters, empty boxes will be displayed in place of the expected text.
Part of the code changes comes from Qt4 code.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit e0a38072cf48a6819a5cd788588267f3441d9d6a)
Diffstat (limited to 'src/kernel/qpainter.cpp')
| -rw-r--r-- | src/kernel/qpainter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/qpainter.cpp b/src/kernel/qpainter.cpp index 4868ffb00..23894b09f 100644 --- a/src/kernel/qpainter.cpp +++ b/src/kernel/qpainter.cpp @@ -2941,12 +2941,12 @@ void qt_format_text( const TQFont& font, const TQRect &_r, int desc = fm.descent(); height = -leading; - //tqDebug("\n\nbeginLayout: lw = %d, rectwidth=%d", lineWidth , r.width()); + //tqDebug("beginLayout: lw = %d, rectwidth=%d", lineWidth , r.width()); while ( !textLayout.atEnd() ) { height += leading; - textLayout.beginLine( lineWidth == INT_MAX ? lineWidth : lineWidth ); + textLayout.beginLine( lineWidth ); //tqDebug("-----beginLine( %d )-----", lineWidth ); - bool linesep = FALSE; + bool linesep = false; while ( 1 ) { TQTextItem ti = textLayout.currentItem(); //tqDebug("item: from=%d, ch=%x", ti.from(), text.unicode()[ti.from()].unicode() ); @@ -2971,7 +2971,7 @@ void qt_format_text( const TQFont& font, const TQRect &_r, ti.setWidth( tw ); } if ( ti.isObject() && text.unicode()[ti.from()] == TQChar_linesep ) - linesep = TRUE; + linesep = true; if ( linesep || textLayout.addCurrentItem() != TQTextLayout::Ok || textLayout.atEnd() ) break; |
