Bug 397985 - Round box drawing chars aren't nice
Summary: Round box drawing chars aren't nice
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 17.12.3
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2018-08-28 13:39 UTC by Egmont Koblinger
Modified: 2019-04-22 13:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot (222 bytes, image/png)
2018-08-28 13:39 UTC, Egmont Koblinger
Details
screenshot of mc after antialiasing change (270.07 KB, image/png)
2019-04-21 21:13 UTC, Bo Simonsen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Egmont Koblinger 2018-08-28 13:39:20 UTC
Created attachment 114657 [details]
Screenshot

To reproduce:

echo -e '\u256d\u256e\n\u2570\u256f'

Notice that the upper left corner is hardly rounded, the bottom round corner is rounded the most, the two other ones are halfway between. (Let alone, they could be antialiased.)

I attach a screenshot at character size 18x36px, magnified 10x.

The choice of the font doesn't make a difference. I think that just like the other box drawing characters from the U+2500..U+257F range, these ones are also manually rendered by konsole.
Comment 1 Egmont Koblinger 2018-08-28 13:55:15 UTC
Note that it doesn't get _much_ better at giant font sizes either (and then bug 397986 also becomes relevant).
Comment 2 Christoph Feck 2018-09-13 18:38:31 UTC
QPainter::Antialiasing would help.

https://cgit.kde.org/konsole.git/tree/src/TerminalDisplay.cpp#n771
Comment 3 Kurt Hindenburg 2018-10-06 16:39:44 UTC
Git commit ed5fa1f855a05ba82fe4f2f6d3ead803aa5eefdb by Kurt Hindenburg.
Committed on 06/10/2018 at 16:39.
Pushed by hindenburg into branch 'master'.

Antialias line drawing characters

Summary:

Use antialiasing when drawing unicode box characters to improve the
rendering of rounded corners.

Test Plan:
# Execute `echo -e '\u256d\u256e\n\u2570\u256f'`
# The box should have rounded corners

Before fix:

{F6301318}

After fix:

{F6301319}

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: ngraham, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D15915

M  +4    -1    src/TerminalDisplay.cpp

https://commits.kde.org/konsole/ed5fa1f855a05ba82fe4f2f6d3ead803aa5eefdb
Comment 4 Bo Simonsen 2019-04-21 21:12:41 UTC
Using QPainter::Antialiasing made Konsole behave strange for scaled display, see attached screenshot for "mc". I am running openSUSE LEAP 15.1 where 18.12 has been patched with improvements in rendering of boxes. I tried commenting out paint.setRenderHint(QPainter::Antialiasing, _antialiasText); and that did make mc look normal.
Comment 5 Bo Simonsen 2019-04-21 21:13:19 UTC
Created attachment 119548 [details]
screenshot of mc after antialiasing change
Comment 6 Bo Simonsen 2019-04-21 21:16:06 UTC
By the way, scaling is 1.5
Comment 7 Nate Graham 2019-04-22 13:24:49 UTC
I'm not able to see the problem with box characters in your screenshot. If you're referring to the black lines, that's a pre-existing and unrelated fractional scaling bug: https://bugs.kde.org/show_bug.cgi?id=373232

If there's some other issue besides that which I'm not seeing, we still prefer to track fractional scaling issues with separate bugs so please file one instead of re-opening this one. Thanks!
Comment 8 Bo Simonsen 2019-04-22 13:39:27 UTC
Nate, I am opening a new bug report. The black lines are not related to the bug you mention. The black lines are occuring on scaled displays after the activation of antialiasing. The other HiDPI bug, the lines there are in fact "holes" in the canvas (the line is the same color as the window in the background), could imply some painter calculation are not accurate.
Comment 9 Nate Graham 2019-04-22 13:48:58 UTC
Ah, I see!