Tk Source Code

Check-in [0e34e33c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix [f5b47c533f] (see [59d6d5f6c0]): a tag (e.g. the selection) splitting right-to-left text in a text widget made the line scrambled: the font back-end draws a stretch of text in visual order, but its chunks were placed from left to right in logical order, so the bboxes, the selection highlight and the mouse did not match the text and moved whenever the tags changed. Place the chunks of each stretch in visual order (rule L2 of UAX #9), keep the drawing origin of the stretch and measure from the logical positions, and walk the chunks in visual order for the background and @x,y. tk::TextClosestGap: the gap after a right-to-left character is on its left. Tests textDisp-37.4 to 37.6.
Downloads: See separate download page
Timelines: family | ancestors | descendants | both | text-bidi-chunk-order
Files: files | file ages | folders
SHA3-256: 0e34e33c21dd9f2da9b3622cd1e3137ca3885893b3d718fbfe1f1bcdfb83fc1d
User & Date: serhiy.storchaka 2026-10-30 15:12:49.883
Context
2026-10-31
13:50
Fix the insertion cursor at the start of a line of right-to-left text (see [59d6d5f6c0]): it was drawn at the left end of the line. ReorderBidiChunks() now also moves the zero-width chunks before a stretch. closed check-in: a4124a72 user: serhiy.storchaka tags: text-bidi-chunk-order
2026-10-30
15:12
Fix [f5b47c533f] (see [59d6d5f6c0]): a tag (e.g. the selection) splitting right-to-left text in a text widget made the line scrambled: the font back-end draws a stretch of text in visual order, but its chunks were placed from left to right in logical order, so the bboxes, the selection highlight and the mouse did not match the text and moved whenever the tags changed. Place the chunks of each stretch in visual order (rule L2 of UAX #9), keep the drawing origin of the stretch and measure from the logical positions, and walk the chunks in visual order for the background and @x,y. tk::TextClosestGap: the gap after a right-to-left character is on its left. Tests textDisp-37.4 to 37.6. check-in: 0e34e33c user: serhiy.storchaka tags: text-bidi-chunk-order
14:53
Fix 32-bit warning: tkWinWm.c:1585:25: warning: comparison of integer expressions of different signedness check-in: 2adf72ba user: jan.nijtmans tags: trunk, main
Changes
Unified Diff Side-by-Side Diff Patch
Changes to generic/tkTextDisp.c.
Changes to library/text.tcl.
Changes to tests/textDisp.test.