Tk Source Code

View Ticket
Login
Ticket UUID: 1b22c74dc7da6f546bb34d41599f834cac611bbe
Title: Windows: a label with Hebrew text hangs (endless loop) since the color emoji merge
Type: Bug Version: trunk
Submitter: serhiy.storchaka Created on: 2026-10-13 18:31:41
Subsystem: 47. Win Fonts Assigned To: nobody
Priority: 9 Immediate Severity: Critical
Status: Closed Last Modified: 2026-10-19 17:58:31
Resolution: Fixed Closed By: nab
    Closed on: 2026-10-19 17:58:31
Description:

On Windows, main hangs at 100% CPU when it displays Hebrew text:

label .l -text "\u05d0\u05d1\u05d2 \u05d3\u05d4\u05d5" -font {Courier -12}
pack .l
update

update never returns. textDisp-37.1 hangs the same way, so the Windows test suite does not finish.

It started with the merge of nab-win-color-emoji, [36572376e3]. [a0496a5855] works; [a5c4e4d6dc] and the current main [5f33cd9ec1] hang. Windows 11, MSVC 2022, 64-bit.

User Comments: nab added on 2026-10-19 17:58:31:

Merged into trunk, [6074f9e42d|6074f9e42d], with Kevin's approval. Tested on Windows 11 (clang, MSYS2 UCRT64, 200 % scaling, ANSI code page 1252): the hang does not reproduce here, as the bitmap Courier only claims Latin-1 and the Hebrew goes to Segoe UI; with the fix, winFont.test (winfont-12.1 included), font.test and textDisp.test pass. Thanks Serhiy.


serhiy.storchaka added on 2026-10-13 19:58:15:

It depends on the font that Courier is resolved to. Here (Windows 11) font actual {Courier -12} -family gives Courier, the bitmap font, which claims the Hebrew letters but cannot shape them, and the label hangs. If Courier is Courier New on your system, it has Hebrew and nothing happens. The full Windows test suite hangs in textDisp-37.1 for the same reason. Is this on Windows, with current main?


kevin_walzer added on 2026-10-13 19:00:03:
Not able to reproduce this.

serhiy.storchaka added on 2026-10-13 18:56:55:

Courier claims the Hebrew letters, but Uniscribe cannot shape Hebrew with it (USP_E_SCRIPT_NOT_IN_FONT). The missing glyph fallback only handled a successful shaping, so the range was dropped, nothing was measured, and the layout of the label did not advance. Proposed fix in branch win-script-not-in-font, [d428fb8606]: such a range is reshaped with a fallback font, and text that cannot be shaped at all is measured with the base font. Test winfont-12.1. The full Windows test suite passes.