Tk Source Code

View Ticket
Login
2026-10-19
17:58 • Closed ticket [1b22c74d]: Windows: a label with Hebrew text hangs (endless loop) since the color emoji merge plus 7 other changes artifact: 785f8c0c user: nab
17:02
Fix [1b22c74dc7]: on Windows, a label with Hebrew text in Courier hung. Merge win-script-not-in-font: test winfont-12.1. check-in: 6074f9e4 user: nab tags: trunk, main
2026-10-14
12:49 • New ticket [ecfcec3a] Windows: a range of right-to-left text is measured one character too wide. artifact: ecbe5f71 user: nab
2026-10-13
19:58 • Ticket [1b22c74d] Windows: a label with Hebrew text hangs (endless loop) since the color emoji merge status still Open with 3 other changes artifact: f1f33fb0 user: serhiy.storchaka
19:00 • Ticket [1b22c74d]: 6 changes artifact: 1c8ac058 user: kevin_walzer
18:56 • Ticket [1b22c74d]: 3 changes artifact: 83d778f5 user: serhiy.storchaka
18:56
Fix [1b22c74dc7]: on Windows, a label with Hebrew text in Courier hung. Courier claims the Hebrew letters, but Uniscribe cannot shape Hebrew with it (USP_E_SCRIPT_NOT_IN_FONT), so the range was dropped, nothing was measured, and the line layout did not advance. Reshape such a range with a fallback font, and if nothing can be shaped, measure the characters with the base font. Test winfont-12.1. closed check-in: d428fb86 user: serhiy.storchaka tags: win-script-not-in-font
18:31 • New ticket [1b22c74d] Windows: a label with Hebrew text hangs (endless loop) since the color emoji merge. artifact: 12425b3d user: serhiy.storchaka

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.