Tk Source Code

Check-in [5691e299]
Login

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

Overview
Comment:Added test textDisp-2.36 counting chars and displaychars in presence of soft hyphens.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-1096580fff | soft-hyphen
Files: files | file ages | folders
SHA1: 5691e2993526cea81c9aebf23a20c2364f7d8a3b
User & Date: fvogel 2016-10-16 19:44:24
Context
2016-10-16
20:29
Reasonable fix for [1096580fff] - soft-hyphen in text widget check-in: 1516a46a user: fvogel tags: bug-1096580fff, soft-hyphen
19:44
Added test textDisp-2.36 counting chars and displaychars in presence of soft hyphens. check-in: 5691e299 user: fvogel tags: bug-1096580fff, soft-hyphen
19:16
Added test textDisp-2.35 testing chunks with both tabs and soft hyphens. check-in: edad03b8 user: fvogel tags: bug-1096580fff, soft-hyphen
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/textDisp.test.

561
562
563
564
565
566
567












568
569
570
571
572
573
574
    set res [expr [lindex [.t bbox 1.4] 2] > 0]
    lappend res [lindex [.t bbox 1.14] 2]
    lappend res [expr [lindex [.t bbox 1.25] 2] > 0]
    lappend res [lindex [.t bbox 2.4] 2]
    lappend res [expr [lindex [.t bbox 2.14] 2] > 0]
    lappend res [lindex [.t bbox 2.25] 2]
} [list 1 0 1 0 1 0]













test textDisp-3.1 {different character sizes} {textfonts} {
    .t configure -wrap word
    .t delete 1.0 end
    .t insert end "Some sample text, including both large\n"
    .t insert end "characters and\nsmall\n"
    .t insert end "abc\nd\ne\nfghij"







>
>
>
>
>
>
>
>
>
>
>
>







561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
    set res [expr [lindex [.t bbox 1.4] 2] > 0]
    lappend res [lindex [.t bbox 1.14] 2]
    lappend res [expr [lindex [.t bbox 1.25] 2] > 0]
    lappend res [lindex [.t bbox 2.4] 2]
    lappend res [expr [lindex [.t bbox 2.14] 2] > 0]
    lappend res [lindex [.t bbox 2.25] 2]
} [list 1 0 1 0 1 0]
test textDisp-2.36 {a soft hyphen counts for 1 char even if not visible} {textfonts} {
    .t delete 1.0 end
    .t insert 1.0 "\u00ADSoft\u00AD\u00AD\u00ADhyphen test."
    set res [.t count -chars 1.0 1.14]
    lappend res [.t count -displaychars 1.0 1.14]
    lappend res [.t count -indices 1.0 1.14]
    lappend res [.t count -displayindices 1.0 1.14]
    # All the above results must be same. With or without the "display" modifier
    # makes no difference: despite not being visible the soft hyphens are not
    # *elided* (i.e. not tagged as elided). In other words soft hyphens are
    # displayed and count for 1 char each, but with zero width
} [list 14 14 14 14]

test textDisp-3.1 {different character sizes} {textfonts} {
    .t configure -wrap word
    .t delete 1.0 end
    .t insert end "Some sample text, including both large\n"
    .t insert end "characters and\nsmall\n"
    .t insert end "abc\nd\ne\nfghij"