diff options
author | 2025-04-17 14:45:05 -0400 | |
---|---|---|
committer | 2025-04-26 11:22:03 +0200 | |
commit | 95b05de0a56699392e67590d000df76fedec609a (patch) | |
tree | 1cccefd12bfe1a0caddf00c8a20edc5b93e261d0 /scripts/lib/kdoc/kdoc_parser.py | |
parent | vt: move unicode processing to a separate file (diff) | |
download | linux-rng-95b05de0a56699392e67590d000df76fedec609a.tar.xz linux-rng-95b05de0a56699392e67590d000df76fedec609a.zip |
vt: properly support zero-width Unicode code points
Zero-width Unicode code points are causing misalignment in vertically
aligned content, disrupting the visual layout. Let's handle zero-width
code points more intelligently.
Double-width code points are stored in the screen grid followed by a white
space code point to create the expected screen layout. When a double-width
code point is followed by a zero-width code point in the console incoming
bytestream (e.g., an emoji with a presentation selector) then we may
replace the white space padding by that zero-width code point instead of
dropping it. This maximize screen content information while preserving
proper layout.
If a zero-width code point is preceded by a single-width code point then
the above trick is not possible and such zero-width code point must
be dropped.
VS16 (Variation Selector 16, U+FE0F) is special as it typically doubles
the width of the preceding single-width code point. We handle that case
by giving VS16 a width of 1 instead of 0 when that happens.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250417184849.475581-4-nico@fluxnic.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions