Tk Source Code

View Ticket
Login
Ticket UUID: 1c8aad0efaf0114cf6d533b3977bb61d8a86e85d
Title: Tab justifications other than "left" don't work with -wrap none
Type: Bug Version: revised_text
Submitter: nemethi Created on: 2017-08-15 21:00:39
Subsystem: 18. [text] Assigned To: gcramer
Priority: 5 Medium Severity: Severe
Status: Open Last Modified: 2018-10-23 20:14:27
Resolution: None Closed By: nobody
    Closed on: 2017-08-16 08:36:08
Description:
A very simple test script:

  pack [text .t -tabs {40 right} -wrap none]
  .t insert end \t9\n\t99\n\t999

Expected behavior: All 3 text lines should end at pixel position 40, being displayed right-justified.

Actual behavior: The digits in all 3 text lines start at pixel position 48 and are displayed left-justified.

The tab justifications "center" and "numeric" exhibit a similar mis-behavior.

For the Tablelist package it is quite important that the tabs behave as expected when -wrap is set to none.  Of course, many other libraries and applications need the correct behavior, too.
User Comments: fvogel added on 2018-10-23 20:14:27:

Thanks, Csaba, for your confirmation!

Gregor: so test text-24.25 fails for you when run from the test suite (I have merged this new test in the revised_text branch)? I'll fix this problem when I'll deal with [44e92d896e]. Should happen soon.


gcramer added on 2018-10-23 11:07:15:
With your test script I get the following result:

    {35 2 7 14} {35 16 7 14} {35 30 7 14}

"font actual $fixedFont" gives me (w/o -underline/strikeout):

    -family {Courier New} -size 9 -weight normal -slant roman

nemethi added on 2018-10-23 09:19:11:
I confirm that Tablelist works as expected with the latest state of the revised_text branch.

Many thanks to you both!

fvogel added on 2018-10-22 20:39:31:
I confirm the fiwx is working for me (using the test script from the report above).

I also confirm that the testcase I proposed also works for me. Can you post the output you have? I don't understand what's wrong with this test case.

Csaba, as the OP, could you please confirm whether Tablelist is OK with the latest state of the revised_text branch? Thanks!

gcramer added on 2018-10-22 13:50:10:
Many thanks for your analysis, Francois. I've checked in [c2bbf9464d], containing the lost bugfix. This is fixing the problem with -wrap=none. Unfortunately your script is not working on my system, testing such font related things is a crux. But it works with application Scid, the issue in finder window is solved, now looks like the same as with legacy version.

fvogel added on 2018-10-10 16:01:46:

Fossil bisect points at [69597ce024] as the commit that regressed on this. So this ever worked with the revised text widget during only 3 days!

A possible testcase we should add in the test suite (using hardcoded expected results for the time being):

test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts} -setup {
    text .tt -tabs {40 right} -wrap none -font $fixedFont
    pack .tt
} -body {
    .tt insert end \t9\n\t99\n\t999
    update
    list [.tt bbox 1.1] [.tt bbox 2.2] [.tt bbox 3.3]
} -cleanup {
    destroy .tt
} -result {{38 5 7 15} {38 20 7 15} {38 35 7 15}}

This currently fails with the revised text version, and passes with the legacy version. Adding this would guard against later regressions.


fvogel added on 2018-10-10 12:07:53:

Reopening since the fix was lost.

See duplicate ticket [2cffb7ae57] detailing the story.


nemethi added on 2017-08-16 08:08:36:
Many thanks, I can confirm that now it works as expected.

gcramer added on 2017-08-15 22:11:48:
Working again with [205c9e7726], -wrap=none wasn't tested yet.