Clip character drawing to its own cell
ClosedPublic

Authored by mglb on Mar 11 2018, 4:52 PM.

Details

Summary

To calculate string width, Konsole uses character cell widths.
Rendering engine uses actual characters widths for this purpose.
Those sizes are equal in fixed-width fonts, as long as the font
has specific character. Since no font contains all Unicode characters,
some of them are taken from different fonts and their sizes differ
from their cell size. This can lead to different results depending
on how text line is split into strings.

It can be assumed that characters in Basic Latin block in every
fixed-width font are really fixed-width, and can be rendered as one
string. All other characters are rendered separately, and their
rendering surface is limited to their cell.

Before/After screenshots:

BUG: 361547

Test Plan

Paste this: ⸻test in konsole and highlight different parts of the string

In a text editor paste this:

| A |
| ⸻ |
| ⟹ |
| ⧠ |

and move cursor vertically through characters column

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mglb requested review of this revision.Mar 11 2018, 4:52 PM
mglb created this revision.

Thanks, so this basically forces the character into single width which can cut off part of the character. It looks better and correct the cursor/insert issues.

If you're using arc to upload these, can you include your email/name so using --author when I commit isn't required?

I'm tempted to have you re-upload this w/o the whitespace/indent changes; that makes it much easier to see only 3 lines are changing.

mglb updated this revision to Diff 29342.Mar 12 2018, 6:21 PM

I've uploaded the diff using Arc. As I see whitespace is ignored in preview. I'm not sure about authorship.

Anyone else have a comment on this?

I'm a bit concerned about committing this close to 18.04 release. After this week, 18.04 should be split off .

mglb added a comment.EditedMar 22 2018, 9:32 PM

No, it does not.

hindenburg accepted this revision.Apr 2 2018, 4:16 PM

OK, unless someone objects, I'm going to commit this. Note with this certain "characters" will be cut-off if they would be rendered outside their cell.

This revision is now accepted and ready to land.Apr 2 2018, 4:16 PM
This revision was automatically updated to reflect the committed changes.