BUG: 397985
Use antialiasing when drawing unicode box characters to improve the
rendering of rounded corners.
hindenburg |
Konsole |
BUG: 397985
Use antialiasing when drawing unicode box characters to improve the
rendering of rounded corners.
Before fix:
After fix:
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Could you add a screenshot to the Test Plan section?
I suspect that the test fix should be done in a separate patch, too.
@ngraham Sure, I added screenshots of the change and removed the unit test fix. Will create a separate patch for that.
Kurt, please use 'git commit --author=...' to give proper attribution to patches from contributors.
The lines look blurred, are they rendered using integer coordinates? If yes, they end up between pixels, instead of centered in a pixel.
Yes, it looks like integers are used to draw line chars: https://cgit.kde.org/konsole.git/tree/src/TerminalDisplay.cpp#n613
Let me try to change it float and see if that fixes the blurriness.
Thanks for the reminder. I wish arc had a way to notify me when landing that the author isn't correct.
there's some new ugly artifacts between linechars now:
seems to still appear if I change to float.
this is how it looks without enabling antialiasing:
and this shouldn't be enabled if TerminalDisplay::antialias() is false anyways, I guess.
Converting int to float does not make lines appear at pixel centers. They need to be shifted by 0.5 pixels in each direction.
I tried a few more things. Unfortunately i've not been able to get rid of the blurriness, even when shifting by 0.5 pixels. To avoid the ugly artifacts i'm now only using antialiasing to draw the rounded corner characters and shift them by 1 pixel. It's still not pretty though:
Also, i will enable this only when the antialiasing() property is set. Let me know what you think. Alternatively we could also revert this change and live with the ugly but at least sharp corners on smaller font sizes.
I think it makes sense to revert to drawing the box chars without anti-aliasing. using the box chars in the font itself is supposed to be the right and pretty way, so I think it's a fair tradeoff to let the built-in box chars look a bit uglier but more correct. or something like that.