These two code points have Grapheme_Cluster_Break=SpacingMark but a
width of one, the only such code points in Unicode. Grapheme
segmentation (GB9a) adds them to the previous cell, so "จำ" occupied a
single cell in kitty while wcwidth() based programs count two. As a
result the SARA AA glyph was clipped, only the nikhahit was visible and
the cursor drifted right by one cell per AM.
Now, when such a code point combines into a plain one cell wide cell,
the cell is widened to two cells, using the same mechanism as U+FE0F
does for narrow emoji. The C and Go wcswidth() implementations are
updated to match so that kitty's own width calculations agree with the
screen.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit makes the following changes to the text sizing protocol's docs, to describe Kitty's current Unicode behavior more precisely in the text sizing protocol docs (#8533).
These changes describe **behavior that Kitty *already* has**. It does not require any changes to any actual Kitty source code. (I don't know if Foot currently matches this behavior.)
1. The algorithm for splitting text into cells now uses the phrases
"code point" or "Unicode scalar value" instead of "Unicode character",
which is an ambiguous phrase.
2. The algorithm now requires that the terminal uses UTF-8 to decode the bytes it receives into Unicode scalar values.
3. The algorithm now requires that the terminal replace each maximal subpart of any ill-formed subsequence with U+FFFD REPLACEMENT CHARACTER (�).