Clip character drawing to its own cell

Authored by mglb on Apr 2 2018, 3:37 PM.

Description

Clip character drawing to its own cell

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

Reviewers: Konsole, hindenburg

Reviewed By: Konsole, hindenburg

Subscribers: hindenburg, ngraham, Konsole

Tags: Konsole

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

Details

Committed
hindenburgApr 3 2018, 12:11 AM
Reviewer
Konsole
Differential Revision
D11237: Clip character drawing to its own cell
Parents
R319:fb812c75ba08: Fix 2 issues: don't use last() on temp object and use for loop reference
Branches
Unknown
Tags
Unknown