Assertion Failure calculating glyph spacing with certain UTF-8 chars #773

Open
opened 2026-01-30 22:03:46 +00:00 by claunia · 0 comments
Owner

Originally created by @oising on GitHub (May 7, 2019).

Originally assigned to: @miniksa on GitHub.

  • Your Windows build number: (Type ver at a Windows Command Prompt)

10.0.18362.53

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)

Attempting to display the contents of an UTF-8 encoded text file, and an assertion failure occurs in std::vector, in turn caused by an array index out of bounds exception in CustomTextLayout.cpp with _textClusterColumns:

   for (auto i = run.glyphStart; i < (run.glyphStart + run.glyphCount); i++)
        {
            // Advance is how wide in pixels the glyph is
            auto& advance = _glyphAdvances[i];

            // Offsets is how far to move the origin (in pixels) from where it is
            auto& offset = _glyphOffsets[i];

            // Get how many columns we expected the glyph to have and mutiply into pixels.
            const auto columns = _textClusterColumns[i];    // <<< HERE
  • What's wrong / what should be happening instead:

it shud wurkkk.

I've attached the UTF-8 "torture test" text file that triggers the exception. I'm guessing this could be useful to integrate into your CI. Don't forget to chcp 65001 before cat'ing it in cmd ;)

UTF-8-demo.txt

Originally created by @oising on GitHub (May 7, 2019). Originally assigned to: @miniksa on GitHub. * Your Windows build number: (Type `ver` at a Windows Command Prompt) 10.0.18362.53 * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) Attempting to display the contents of an UTF-8 encoded text file, and an assertion failure occurs in `std::vector`, in turn caused by an array index out of bounds exception in `CustomTextLayout.cpp` with `_textClusterColumns`: ```cpp for (auto i = run.glyphStart; i < (run.glyphStart + run.glyphCount); i++) { // Advance is how wide in pixels the glyph is auto& advance = _glyphAdvances[i]; // Offsets is how far to move the origin (in pixels) from where it is auto& offset = _glyphOffsets[i]; // Get how many columns we expected the glyph to have and mutiply into pixels. const auto columns = _textClusterColumns[i]; // <<< HERE ``` * What's wrong / what should be happening instead: it shud wurkkk. I've attached the UTF-8 "torture test" text file that triggers the exception. I'm guessing this could be useful to integrate into your CI. Don't forget to `chcp 65001` before `cat`'ing it in cmd ;) [UTF-8-demo.txt](https://github.com/microsoft/Terminal/files/3153810/UTF-8-demo.txt)
claunia added the Resolution-Fix-AvailableArea-RenderingIssue-BugProduct-Terminal labels 2026-01-30 22:03:46 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#773