|
2026-10-31
| ||
| 08:58 | Merge canvtext-long-text-test: fix [271f61c768]: canvText-22.1 measures parts of the text instead of multiplying the width of one character, and covers the 512-glyph limit of the shaper ([4eef1fa86e]). Remove the aquaKnownBug constraint. check-in: ecd09bd7 user: serhiy.storchaka tags: trunk, main | |
|
2026-10-16
| ||
| 18:05 | • Ticket [271f61c7] Aqua: the end of a long canvas text item is not drawn status still Open with 3 other changes artifact: 7c840357 user: serhiy.storchaka | |
| 08:01 | • Ticket [271f61c7]: 3 changes artifact: 9ca8db7f user: serhiy.storchaka | |
| 08:00 |
canvText-22.1: measure parts of the text instead of multiplying the width of one character, and shape the text.
The advance width can be fractional (on Aqua), and the width of one character is rounded, so the test scrolled past the end of the text [271f61c768]. A leading CJK character makes the whole text shaped, so the test also covers the 512-glyph limit of the shaper [4eef1fa86e]; the text is measured in parts shorter than 512 characters. Remove the aquaKnownBug constraint. closed check-in: 6a518b37 user: serhiy.storchaka tags: canvtext-long-text-test | |
|
2026-10-13
| ||
| 11:30 | • Closed ticket [4eef1fa8]: 9.1b1 X11 (HarfBuzz/SheenBidi font backend): strings longer than 512 characters are truncated when drawn, and glyphs beyond 16-bit coordinates wrap around plus 6 other changes artifact: 67c4539f user: kevin_walzer | |
| 05:15 | • Ticket [965dae4a] X11 font backend: stack buffer overflow (crash) for strings of 1024 or more bytes, e.g. 344 CJK characters status still Open with 3 other changes artifact: 3c212b00 user: serhiy.storchaka | |
|
2026-09-29
| ||
| 11:38 | • Ticket [4eef1fa8] 9.1b1 X11 (HarfBuzz/SheenBidi font backend): strings longer than 512 characters are truncated when drawn, and glyphs beyond 16-bit coordinates wrap around status still Open with 3 other changes artifact: d9ff30f5 user: serhiy.storchaka | |
| 11:36 |
X11 (HarfBuzz/SheenBidi font backend): remove the 512-glyph limit of the shaper [4eef1fa86e]
Text shaped by HarfBuzz (RTL scripts, CJK, ...) was cut at 512 glyphs when drawn and measured. The shaped glyph buffer now uses arrays which grow as needed, and the bidi run, subrun and cluster tables are sized by the string. The cluster breaks and the cluster table are built without quadratic loops. check-in: 9c320362 user: serhiy.storchaka tags: x11-shaper-unlimited | |
| 09:41 |
X11 (HarfBuzz/SheenBidi font backend): fix a stack buffer overflow for strings of 1024 or more bytes [4eef1fa86e]
X11Shaper_ShapeString() marked cluster boundaries in a char array of 1024 elements indexed by byte offsets, so shaping a longer string, e.g. about 350 CJK characters, overwrote the stack and crashed. Size the array by the string. check-in: 7889ba20 user: serhiy.storchaka tags: x11-shaper-long-string | |
| 09:10 | • Ticket [4eef1fa8] 9.1b1 X11 (HarfBuzz/SheenBidi font backend): strings longer than 512 characters are truncated when drawn, and glyphs beyond 16-bit coordinates wrap around status still Open with 7 other changes artifact: e49a2f88 user: anonymous | |
|
2026-09-23
| ||
| 08:22 | • Ticket [4eef1fa8]: 4 changes artifact: e98dc0d7 user: serhiy.storchaka | |
|
2026-09-22
| ||
| 09:35 | • Ticket [770578ff] long text item won't scroll status still Open with 4 other changes artifact: fea4c8f8 user: serhiy.storchaka | |
| 09:35 | • Ticket [4eef1fa8] 9.1b1 X11 (HarfBuzz/SheenBidi font backend): strings longer than 512 characters are truncated when drawn, and glyphs beyond 16-bit coordinates wrap around status still Open with 3 other changes artifact: 817fbdf8 user: serhiy.storchaka | |
| 09:29 |
Fix [4eef1fa86e]: X11 (HarfBuzz/SheenBidi font backend): strings longer than 512 characters are truncated when drawn, and glyphs beyond 16-bit coordinates wrap around
The glyphs are now drawn in batches of 512, and glyphs outside the 16-bit coordinate range of Xft are skipped, as in the Xft backend. This also fixes [770578] for this backend. check-in: 4c1e52f0 user: serhiy.storchaka tags: x11-bidi-long-text | |
| 09:29 | • New ticket [4eef1fa8] 9.1b1 X11 (HarfBuzz/SheenBidi font backend): strings longer than 512 characters are truncated when drawn, and glyphs beyond 16-bit coordinates wrap around. artifact: 8c826cc8 user: serhiy.storchaka | |
| Ticket UUID: | 4eef1fa86e61ce5f6fbfce23d90a6e422b2719b4 | |||
| Title: | 9.1b1 X11 (HarfBuzz/SheenBidi font backend): strings longer than 512 characters are truncated when drawn, and glyphs beyond 16-bit coordinates wrap around | |||
| Type: | Bug | Version: | 9.1b1 | |
| Submitter: | serhiy.storchaka | Created on: | 2026-09-22 09:29:01 | |
| Subsystem: | 46. Unix Fonts | Assigned To: | aku | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2026-10-13 11:30:59 | |
| Resolution: | Fixed | Closed By: | kevin_walzer | |
| Closed on: | 2026-10-13 11:30:59 | |||
| Description: |
The glyph drawing loops in tkUnixBidiFont.c collect glyphs in a fixed array of MAX_GLYPHS (512) XftGlyphFontSpec and stop when it is full, so anything drawn with more than 512 characters in one call is cut off. A canvas text item with 600 characters shows only the first 512:
canvas .c -width 300 -height 60 -scrollregion {0 0 20000 60}
pack .c
.c create text 0 20 -anchor w -text [string repeat M 600] -font {Courier 12}
.c xview moveto 0.3
The loops also store the positions in the 16-bit x and y fields of XftGlyphFontSpec without a check, so glyphs beyond ±32767 pixels wrap around instead of being skipped, as the Xft backend does since [bce3c9222f] (8.6.9). This is what makes the old [770578] (a very long canvas text item disappears when scrolled) fail again on 9.1: only the first 512 characters were drawn at all. The text and entry widgets are not affected, they draw in shorter ranges. The shaper for complex scripts (ShapedGlyphBuffer and the run lists) has fixed 512-glyph buffers as well, so a single complex-script string longer than that is still truncated by the shaping; that is not addressed here. | |||
| User Comments: |
kevin_walzer added on 2026-10-13 11:30:59:
Fix merged to trunk. Thank you. serhiy.storchaka added on 2026-09-29 11:38:46: Thanks for testing! Checking the shaper, I found that strings of 1024 or more bytes shaped by HarfBuzz even crash the application, see [965dae4a6d]. The 512-glyph limit of the shaper is removed in branch x11-shaper-unlimited (based on x11-bidi-long-text, which now also includes the fix for [965dae4a6d]). Now font measure {sans-serif 10} [string repeat \u4e2d 600] returns 8400, as in 9.0, and long RTL text is drawn completely. Test unixfont-10.2. anonymous added on 2026-09-29 09:10:31: Tested branch x11-bidi-long-text (1e3ca6c160) on Linux/X11: a 600-character
Latin label and a 600-character "-wrap none" text line now draw completely;
on 9.1.0rc1 both were blank after glyph 512. Thanks.
One case the branch does not cover: text that IsSimpleOnly() sends through
HarfBuzz (RTL scripts, CJK, ...) is still cut at 512 glyphs, because the
shaping buffer itself is capped (X11Shaper_ShapeString: "glyphCount <
MAX_GLYPHS", and the MAX_GLYPHS-sized glyphs[]/visualIndex[] arrays in
the buffer). Even the measurement is affected:
font measure {sans-serif 10} [string repeat \u4e2d 600]
font measure {sans-serif 10} [string repeat \u4e2d 512]
both return 7168 on the branch (and 9.0.4 returns 8400 for the first). The
same happens with Hebrew (\u05d0): 4608 for both lengths.
Jan ([email protected])
serhiy.storchaka added on 2026-09-22 09:35:39: Fixed in [4c1e52f0d9] (branch x11-bidi-long-text): the glyphs are drawn in batches of 512 (AddGlyph()/FlushGlyphs()) in all four drawing loops, and glyphs outside the 16-bit range are skipped. Tests canvText-22.1 (item of 1000 characters) and canvText-22.2 (the item of [770578] scrolled by up to 100000 pixels). The 512-glyph limit of the shaper for complex scripts remains. | |||
