Hello community, here is the log from the commit of package konsole for openSUSE:Factory checked in at 2019-03-12 09:48:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/konsole (Old) and /work/SRC/openSUSE:Factory/.konsole.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "konsole" Tue Mar 12 09:48:31 2019 rev:108 rq:683234 version:18.12.3 Changes: -------- --- /work/SRC/openSUSE:Factory/konsole/konsole.changes 2019-03-08 11:59:45.767971545 +0100 +++ /work/SRC/openSUSE:Factory/.konsole.new.28833/konsole.changes 2019-03-12 09:48:34.691595907 +0100 @@ -1,0 +2,26 @@ +Sat Mar 09 08:03:20 UTC 2019 - [email protected] + +- Update to 18.12.3 + * New bugfix release + * For more details please see: + * https://www.kde.org/announcements/announce-applications-18.12.3.php +- Changes since 18.12.2: + * No code changes since 18.12.2 + +------------------------------------------------------------------- +Wed Mar 6 10:58:14 UTC 2019 - [email protected] + +- Add upstream patches to improve and/or fix rendering of + line/block chars, cursors, and characters with wide glyphs: + * Add-special-support-for-block-characters.patch + * Extend-character-clipping-by-grouping-it-with-spaces.patch + (kde#401298) + * Improve-built-in-line_block-characters-drawing.patch + (kde#402415) + * Fix-ibeam-and-underline-cursor-rendering.patch (kde#402589) +- Drop patches to disable antialiasing as the rendering problems + are fixed by above patches: + * 0001-Revert-fix-drawing-box-chars-avoid-storing-and-savin.patch + * 0002-Revert-Antialias-line-drawing-characters.patch + +------------------------------------------------------------------- Old: ---- 0001-Revert-fix-drawing-box-chars-avoid-storing-and-savin.patch 0002-Revert-Antialias-line-drawing-characters.patch konsole-18.12.2.tar.xz New: ---- Add-special-support-for-block-characters.patch Extend-character-clipping-by-grouping-it-with-spaces.patch Fix-ibeam-and-underline-cursor-rendering.patch Improve-built-in-line_block-characters-drawing.patch konsole-18.12.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ konsole.spec ++++++ --- /var/tmp/diff_new_pack.ApeTBs/_old 2019-03-12 09:48:35.591595728 +0100 +++ /var/tmp/diff_new_pack.ApeTBs/_new 2019-03-12 09:48:35.595595728 +0100 @@ -21,7 +21,7 @@ %{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} %bcond_without lang Name: konsole -Version: 18.12.2 +Version: 18.12.3 Release: 0 Summary: KDE Terminal License: GPL-2.0-or-later @@ -38,10 +38,12 @@ Source26: utilities-terminal-su-128.png # PATCH-FIX-UPSTREAM Patch0: Fix-bold-font.patch +Patch1: Add-special-support-for-block-characters.patch +Patch2: Extend-character-clipping-by-grouping-it-with-spaces.patch +Patch3: Improve-built-in-line_block-characters-drawing.patch +Patch4: Fix-ibeam-and-underline-cursor-rendering.patch # PATCH-FIX-OPENSUSE Patch100: fix-build-with-gcc48.patch -Patch101: 0001-Revert-fix-drawing-box-chars-avoid-storing-and-savin.patch -Patch102: 0002-Revert-Antialias-line-drawing-characters.patch BuildRequires: fdupes BuildRequires: kbookmarks-devel BuildRequires: kcompletion-devel ++++++ Add-special-support-for-block-characters.patch ++++++ >From d39d51973a34d949bf9ae035344c4f2b861e9d0b Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" <[email protected]> Date: Sun, 9 Dec 2018 19:21:21 -0500 Subject: Add special support for block characters Summary: Similar to the line chars, block chars look much better if we handle them ourselves. Test Plan: `cat tests/boxes.txt` and `cat tests/UTF-8-demo.txt` Reviewers: #konsole, hindenburg Reviewed By: #konsole, hindenburg Subscribers: konsole-devel, #konsole Tags: #konsole Differential Revision: https://phabricator.kde.org/D17294 --- src/Character.h | 5 +- src/TerminalDisplay.cpp | 138 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 140 insertions(+), 3 deletions(-) diff --git a/src/Character.h b/src/Character.h index 933912b..ed54715 100644 --- a/src/Character.h +++ b/src/Character.h @@ -63,8 +63,9 @@ const RenditionFlags RE_OVERLINE = (1 << 10); */ inline bool isSupportedLineChar(uint codePoint) { - return (codePoint & 0xFF80) == 0x2500 // Unicode block: Mathematical Symbols - Box Drawing - && !(0x2504 <= codePoint && codePoint <= 0x250B); // Triple and quadruple dash range + return ((codePoint & 0xFF80) == 0x2500 // Unicode block: Mathematical Symbols - Box Drawing + && !(0x2504 <= codePoint && codePoint <= 0x250B)) || // Triple and quadruple dash range + (codePoint >= 0x2580 && codePoint <= 0x259F); // Block characters } /** diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 87db09f..20dd022 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -783,6 +783,139 @@ static void drawOtherChar(QPainter& paint, int x, int y, int w, int h, uchar cod } } +static void drawBlockChar(QPainter& paint, int x, int y, int w, int h, uchar code) +{ + const QColor color = paint.pen().color(); + + const float left = x - 0.5; + const float top = y - 0.5; + + const float cx = left + w / 2; + const float cy = top + h / 2; + const float right = x + w - 0.5; + const float bottom = y + h - 0.5; + + // Default rect fills entire cell + QRectF rect(left, top, w, h); + + // LOWER ONE EIGHTH BLOCK to LEFT ONE EIGHTH BLOCK + if (code >= 0x81 && code <= 0x8f) { + if (code < 0x88) { // Horizontal + const int height = h * (0x88 - code) / 8; + rect.setY(top + height); + rect.setHeight(h - height); + } else if (code > 0x88) { // Vertical + const int width = w * (0x90 - code) / 8; + rect.setWidth(width); + } + + paint.fillRect(rect, color); + + return; + } + + // Combinations of quarter squares + // LEFT ONE EIGHTH BLOCK to QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT + if (code >= 0x96 && code <= 0x9F) { + bool upperLeft = false, upperRight = false, + lowerLeft = false, lowerRight = false; + + switch(code) { + case 0x96: + lowerLeft = true; + break; + case 0x97: + lowerRight = true; + break; + case 0x98: + upperLeft = true; + break; + case 0x99: + upperLeft = true; + lowerLeft = true; + lowerRight = true; + break; + case 0x9a: + upperLeft = true; + lowerRight = true; + break; + case 0x9b: + upperLeft = true; + upperRight = true; + lowerLeft = true; + break; + case 0x9c: + upperLeft = true; + upperRight = true; + lowerRight = true; + break; + case 0x9d: + upperRight = true; + break; + case 0x9e: + upperRight = true; + lowerLeft = true; + break; + case 0x9f: + upperRight = true; + lowerLeft = true; + lowerRight = true; + break; + default: + break; + } + + if (upperLeft) { + paint.fillRect(QRectF(QPointF(left, top), QPointF(cx, cy)), color); + } + if (upperRight) { + paint.fillRect(QRectF(QPointF(cx, top), QPointF(right, cy)), color); + } + if (lowerLeft) { + paint.fillRect(QRectF(QPointF(left, cy), QPointF(cx, bottom)), color); + } + if (lowerRight) { + paint.fillRect(QRectF(QPointF(cx, cy), QPointF(right, bottom)), color); + } + + return; + } + + // And the random stuff + switch(code) { + case 0x80: // Top half block + rect.setHeight(h / 2); + paint.fillRect(rect, color); + return; + case 0x90: // Right half block + paint.fillRect(QRectF(QPointF(cx, top), QPointF(right, bottom)), color); + return; + case 0x94: // Top one eighth block + rect.setHeight(h / 8); + paint.fillRect(rect, color); + return; + case 0x95: { // Right one eighth block + const float width = 7 * w / 8; + rect.setX(left + width); + rect.setWidth(w - width); + paint.fillRect(rect, color); + return; + } + case 0x91: // Light shade + paint.fillRect(rect, QBrush(color, Qt::Dense6Pattern)); + return; + case 0x92: // Medium shade + paint.fillRect(rect, QBrush(color, Qt::Dense4Pattern)); + return; + case 0x93: // Dark shade + paint.fillRect(rect, QBrush(color, Qt::Dense2Pattern)); + return; + + default: + break; + } +} + void TerminalDisplay::drawLineCharString(QPainter& painter, int x, int y, const QString& str, const Character* attributes) { @@ -800,7 +933,10 @@ void TerminalDisplay::drawLineCharString(QPainter& painter, int x, int y, const for (int i = 0 ; i < str.length(); i++) { const uchar code = str[i].cell(); - if (LineChars[code] != 0u) { + + if (code >= 0x80 && code <= 0x9F) { // UPPER HALF BLOCK to QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT + drawBlockChar(painter, x + (_fontWidth * i), y, _fontWidth, _fontHeight, code); + } else if (LineChars[code] != 0u) { drawLineChar(painter, x + (_fontWidth * i), y, _fontWidth, _fontHeight, code); } else { drawOtherChar(painter, x + (_fontWidth * i), y, _fontWidth, _fontHeight, code); -- cgit v1.1 ++++++ Extend-character-clipping-by-grouping-it-with-spaces.patch ++++++ >From ed6d8b702fd590d83d3b1db25bf2d1245b1cae33 Mon Sep 17 00:00:00 2001 From: Mariusz Glebocki <[email protected]> Date: Fri, 15 Feb 2019 21:50:47 -0500 Subject: Extend character clipping by grouping it with spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Group spaces following any non-wide character with the character. This allows for rendering ambiguous characters with wide glyphs without clipping them. Characters are still clipped when followed by another visible character. {F6591346} BUG 401298 Test Plan: * Display: `⛰ ⛩ ` and/or: * Install Font Awesome or other font with square icons in Private Use Area * Pick some icons using KCharSelect or similar tool (or copy this: ` `) * Put space after each icon and display them in Konsole **Actual result:** Only left half of icons is rendered **Expected result:** Full icon should be rendered (it can be clipped on top or bottom though) Reviewers: #konsole, hindenburg Reviewed By: #konsole, hindenburg Subscribers: hindenburg, konsole-devel Tags: #konsole Differential Revision: https://phabricator.kde.org/D18784 --- src/TerminalDisplay.cpp | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 3f4b943..76cdae3 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -1893,14 +1893,27 @@ void TerminalDisplay::drawContents(QPainter& paint, const QRect& rect) const RenditionFlags currentRendition = _image[loc(x, y)].rendition; const bool rtl = isRtl(_image[loc(x, y)]); - if(_image[loc(x, y)].character <= 0x7e || rtl) { - while (x + len <= rect.right() && - _image[loc(x + len, y)].foregroundColor == currentForeground && - _image[loc(x + len, y)].backgroundColor == currentBackground && - (_image[loc(x + len, y)].rendition & ~RE_EXTENDED_CHAR) == (currentRendition & ~RE_EXTENDED_CHAR) && - (_image[qMin(loc(x + len, y) + 1, _imageSize - 1)].character == 0) == doubleWidth && - _image[loc(x + len, y)].isLineChar() == lineDraw && - (_image[loc(x + len, y)].character <= 0x7e || rtl)) { + const auto isInsideDrawArea = [&](int column) { return column <= rect.right(); }; + const auto hasSameColors = [&](int column) { + return _image[loc(column, y)].foregroundColor == currentForeground + && _image[loc(column, y)].backgroundColor == currentBackground; + }; + const auto hasSameRendition = [&](int column) { + return (_image[loc(column, y)].rendition & ~RE_EXTENDED_CHAR) + == (currentRendition & ~RE_EXTENDED_CHAR); + }; + const auto hasSameWidth = [&](int column) { + const int characterLoc = qMin(loc(column, y) + 1, _imageSize - 1); + return (_image[characterLoc].character == 0) == doubleWidth; + }; + const auto canBeGrouped = [&](int column) { + return _image[loc(column, y)].character <= 0x7e || rtl; + }; + + if (canBeGrouped(x)) { + while (isInsideDrawArea(x + len) && hasSameColors(x + len) + && hasSameRendition(x + len) && hasSameWidth(x + len) + && canBeGrouped(x + len)) { const uint c = _image[loc(x + len, y)].character; if ((_image[loc(x + len, y)].rendition & RE_EXTENDED_CHAR) != 0) { // sequence of characters @@ -1929,6 +1942,15 @@ void TerminalDisplay::drawContents(QPainter& paint, const QRect& rect) } len++; } + } else { + // Group spaces following any non-wide character with the character. This allows for + // rendering ambiguous characters with wide glyphs without clipping them. + while (!doubleWidth && isInsideDrawArea(x + len) + && _image[loc(x + len, y)].character == ' ' && hasSameColors(x + len) + && hasSameRendition(x + len)) { + // disstrU intentionally not modified - trailing spaces are meaningless + len++; + } } if ((x + len < _usedColumns) && (_image[loc(x + len, y)].character == 0u)) { len++; // Adjust for trailing part of multi-column character -- cgit v1.1 ++++++ Fix-ibeam-and-underline-cursor-rendering.patch ++++++ >From eccfb1f62bbf67ebffee11e241bd05757b826ff1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bauer <[email protected]> Date: Mon, 4 Mar 2019 09:59:45 -0500 Subject: Fix ibeam and underline cursor rendering Summary: Since anti-aliasing was enabled in the painter, coordinates need to be shifted half a pixel so that they align with the pixel grid, otherwise the result gets "blurred" due to the anti-aliasing. And as parts of the blurred shape leak outside the cursor rectangle, this also leaves artifacts when the cursor moves or blinks as these parts are not cleared. This is basically the same as commit e7085310d6d594823d0ed491fa8bdbd99dec4932 for the standard block cursor. BUG: 402589 Test Plan: - Switch cursor shape to "I-Beam" or "Underline" in the "Advanced" profile settings The cursors are a single line again now, before they were blurred by anti-aliasing. Screenshots: Before: {F6656366} {F6656370} After: {F6656371} {F6656373} Also, there are no more artifacts when the cursor is moved or cursor blinking is enabled. Reviewers: #konsole, hindenburg Reviewed By: #konsole, hindenburg Subscribers: hindenburg, konsole-devel Tags: #konsole Differential Revision: https://phabricator.kde.org/D19513 --- src/TerminalDisplay.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 543b897..397422c 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -716,16 +716,18 @@ void TerminalDisplay::drawCursor(QPainter& painter, } } } else if (_cursorShape == Enum::UnderlineCursor) { - painter.drawLine(cursorRect.left(), - cursorRect.bottom(), - cursorRect.right(), - cursorRect.bottom()); + QLineF line(cursorRect.left() + 0.5, + cursorRect.bottom() - 0.5, + cursorRect.right() - 0.5, + cursorRect.bottom() - 0.5); + painter.drawLine(line); } else if (_cursorShape == Enum::IBeamCursor) { - painter.drawLine(cursorRect.left(), - cursorRect.top(), - cursorRect.left(), - cursorRect.bottom()); + QLineF line(cursorRect.left() + 0.5, + cursorRect.top() + 0.5, + cursorRect.left() + 0.5, + cursorRect.bottom() - 0.5); + painter.drawLine(line); } } -- cgit v1.1 ++++++ Improve-built-in-line_block-characters-drawing.patch ++++++ ++++ 2541 lines (skipped) ++++++ konsole-18.12.2.tar.xz -> konsole-18.12.3.tar.xz ++++++ ++++ 4990 lines of diff (skipped)
