Cleanup previous PR and make VS15 on explicit width cell behavior consistent with VS16

This commit is contained in:
Kovid Goyal 2026-09-18 22:59:19 +05:30
parent c444b942ef
commit 1fb52b8443
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
6 changed files with 98 additions and 11 deletions

View file

@ -204,6 +204,8 @@ Detailed list of changes
- Thai/Lao: Render the vowel sign AM (U+0E33/U+0EB3) correctly by widening the cell it combines into, matching wcwidth() based programs
- :doc:`Text sizing protocol </text-sizing-protocol>`: A cell whose width was set explicitly with the ``w`` key is no longer narrowed by a subsequent ``U+FE0E`` variation selector
- Support for :doc:`/custom-shaders` for adding various graphical effects (:iss:`10344`)
- Various throughput performance improvements for a 15-35% real world improvement depending on workload

View file

@ -414,8 +414,10 @@ For each decoded code point:
cell and processing of the code point is finished. See the :ref:`var_select`
section below for handling of Unicode Variation selectors. If the code point has
``Grapheme_Cluster_Break=SpacingMark`` and a non-zero width and the previous
cell is one cell wide, the previous cell becomes two cells wide. This affects
only :code:`U+0E33 THAI CHARACTER SARA AM` and :code:`U+0EB3 LAO VOWEL SIGN AM`.
cell is a single, unscaled cell whose width was not set explicitly using the
``w`` key of this protocol, the previous cell becomes two cells wide. This
affects only :code:`U+0E33 THAI CHARACTER SARA AM` and
:code:`U+0EB3 LAO VOWEL SIGN AM`.
#. If there is a boundary, but the width of the current code point is zero,
it is added to the previous cell and processing is finished.
@ -469,17 +471,23 @@ by changing their presentation between ``Emoji_Presentation`` and ``Text_Present
When adding a code point to the previous cell these have to be handled specially.
``U+FE0E`` - Variation Selector 15
When the previous cell has width two and the last code point in the previous
When the previous cell is two cells wide, its width was not set explicitly using
the ``w`` key of this protocol, and the last code point in the previous
cell is one of the ``Basic_Emoji`` code points from the *Wide emoji* rule above
that is *not* followed by ``FEOF`` then the width of the previous cell is
decreased to one.
``U+FE0F`` - Variation Selector 16
When the previous cell has width one and the last code point in the previous
cell is one of the ``Basic_Emoji`` code points from the *Wide emoji* rule above
that is followed by ``FEOF`` then the width of the
When the previous cell is a single, unscaled cell whose width was not set
explicitly using the ``w`` key of this protocol, and the last code point in the
previous cell is one of the ``Basic_Emoji`` code points from the *Wide emoji*
rule above that is followed by ``FEOF`` then the width of the
previous cell is increased to two.
In all three of these cases the width the application requested with the ``w`` key
wins: a cell whose width was set explicitly is never re-sized by a variation
selector or a spacing mark.
Note that the rule for ``U+FE0E`` is particularly problematic for terminals as
it means that the width of a string cannot be determined without knowing the
width of the screen it will be rendered on. This is because when there is only