Improve line height
ClosedPublic

Authored by cullmann on Jan 27 2018, 3:40 PM.

Details

Summary

I played a bit more with KTextEditor on macOS.
It seems we are too restrictive what we use as line height.
The attached patch increases the height by the leading, both in the computation in the renderer for line height + layouting.

I still get some artifacts like in https://bugs.kde.org/show_bug.cgi?id=379727

But I think that is more likely some rendering mis-shape in Qt itself, as you get even artifacts vertically inside a line during the drawing...

Test Plan

For me, less overlapping of lines occur in different zoom variants.

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cullmann created this revision.Jan 27 2018, 3:40 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptJan 27 2018, 3:40 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
cullmann requested review of this revision.Jan 27 2018, 3:40 PM

Is this has same impact in rtl language or some kind of hieroglyphs, it's painted a bit up or down cutted.

Either this patch can improve that or make it worse ;=)
I tried out some .desktop file with different translations inside that have "complex" glyphs and I think it works better now.
If you have time to test that, it would be great.

Btw., that you sometimes get strange artifacts between lines is a Qt issue, happens with QtCreator, too, see my bug https://bugreports.qt.io/browse/QTBUG-66036

rjvbb added a subscriber: rjvbb.Jan 27 2018, 5:28 PM

OK, testing. I'll let you know if I notice anything off.

Testing under Linux, I cannot see any visual difference when selecting the same font in KWrite with and without patch. I guess this is mostly a good sign.
From my side this is a "+1", but a bit more testing also by @rjvbb is certainly appreciated, therefore not yet giving a Ship-It :-)

Next tagging date is 3rd of Febuary (next Saturday). Either you commit this now so we have one week of testing, or you commit right after that date.

rjvbb added a comment.Jan 27 2018, 9:28 PM

I can confirm that the patch appears to have no (side)effect whatsoever when using the Freetype fontengine (available also on Mac with -cocoa:fontengine=freetype!)

The resulting lineheight looks fine when using the standard Mac CoreText fontengine, and I cannot get the white lines in multi-line selected text. I do notice something. Apparently unrelated (also happens without the patch, but since we're talking about white lines...) :

Thanks for testing, will apply that then now ;=)

For the vertical lines: yes, that is exactly the same effect you get with some font sizes horizontally.

Hope they fix that in bug https://bugreports.qt.io/browse/QTBUG-66036

This revision was not accepted when it landed; it landed in state Needs Review.Jan 28 2018, 8:24 AM
This revision was automatically updated to reflect the committed changes.