https://bugs.winehq.org/show_bug.cgi?id=39051
Bug ID: 39051 Summary: TabbedTextOut() incorrect output on tab character Product: Wine Version: 1.7.29 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: minor Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: wine@goabq.org Distribution: ---
Created attachment 52021 --> https://bugs.winehq.org/attachment.cgi?id=52021 testcase (tto.exe) and files to build it
Tab characters do not output correctly when they are output one at a time. This is much worse using a memory device context than a screen device context.
Attached is a testcase. It outputs text to a window using 2 different methods. Clicking in the client area toggles the method. When iterating over each character, TabbedTextOut() produces apparently garbage from the previous line instead of filling the rectangle appropriately as windows does. When drawing the line in a single call, the behavior is as expected. Spaces do not suffer from this problem (illustrated also by the testcase).
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #1 from Eric Mullins wine@goabq.org --- Created attachment 52022 --> https://bugs.winehq.org/attachment.cgi?id=52022 Illustrates problematic behavior via testcase
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #2 from Eric Mullins wine@goabq.org --- Created attachment 52023 --> https://bugs.winehq.org/attachment.cgi?id=52023 Illustrates correct behavior via testcase
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #3 from Eric Mullins wine@goabq.org --- Further experimentation reveals that it's not so much 1 at a time, as the text containing ONLY tab chars. ie: "\t\t\t " will work as expected in a single TabbedTextOut() call because of the inclusion of a space. But "\t\t\t" will exhibit the problematic behavior because it only contains tabs.
Possibly this was an "optimization" in the original code, thinking that a call that contains only tabs need not output anything, only update the delta x as if it were a GetTabbedTextExtent() call. That would explain the fact that the errant output mimics the previoius line-- nothing gets output, so it's still in the bitmap.
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #4 from Eric Mullins wine@goabq.org --- Created attachment 52028 --> https://bugs.winehq.org/attachment.cgi?id=52028 Updated testcase. Includes 3rd method and better test strings
Even a single TabbedTextOut() call with non-tabs can exhibit the problem. This happens when the text terminates with 1 or more tab characters. The new testcase illustrates this.
So in summary: TabbedTextOut() outputs wrong whenever the text string terminates with tabs. This includes situations where the text is only tabs. Beginning with tabs is not problematic if other characters are also to be output.
https://bugs.winehq.org/show_bug.cgi?id=39051
zaplo00@mailfence.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zaplo00@mailfence.com
--- Comment #5 from zaplo00@mailfence.com --- Created attachment 61622 --> https://bugs.winehq.org/attachment.cgi?id=61622 tto.exe wine-3.10
Updated testcase shows garbage in wine-3.10
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #6 from Eric Mullins wine@goabq.org --- Windows must be pre-filling the area underneath tabs with COLOR_WINDOW somehow. Or maybe it's just simulating tabs by drawing spaces-- same effect.
https://bugs.winehq.org/show_bug.cgi?id=39051
Roman roxmail@list.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |roxmail@list.ru
--- Comment #7 from Roman roxmail@list.ru --- It is regression in gdi32 - was introduced in wine-1.6 development cycle (at least it works with 1.4.1 and 1.5.x before 1.5.20, wine-1.5.19 the last version where it was working).
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #8 from Roman roxmail@list.ru --- Created attachment 62459 --> https://bugs.winehq.org/attachment.cgi?id=62459 some emprovement
commit 1c2f23cf2f139fc55e6776033f4eed46f0e44d26 seems to change logic ( inside a get_char_positions(...) ), this patch try to restore it.
https://bugs.winehq.org/show_bug.cgi?id=39051
Eric Mullins wine@goabq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|user32 |gdi32
--- Comment #9 from Eric Mullins wine@goabq.org --- can't compile atm. changed from user32 --> gdi32, thanks.
just browsing the patch, I notice there is an almost identical routine: get_char_positions_indices(). I don't know the difference, but it is likely the changes ought to be in both, or at least make sure one way or the other.
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #10 from Roman roxmail@list.ru --- Created attachment 62463 --> https://bugs.winehq.org/attachment.cgi?id=62463 seems a fix
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #11 from Roman roxmail@list.ru --- Created attachment 62467 --> https://bugs.winehq.org/attachment.cgi?id=62467 Fix
It looks like necessary make a "size->cy = tm.tmHeight" always here.
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #12 from Eric Mullins wine@goabq.org --- I tested both the testcase as well as the application that led me to file the bug report. Both display fine with that patch.
I'd request someone who is able to, read comment 9, and if satisfied with the patch, add it.
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #13 from Roman roxmail@list.ru --- May be better will be filling the bug for real app with link to this bug?
https://bugs.winehq.org/show_bug.cgi?id=39051
--- Comment #14 from Mathew Hodson mathew.hodson@gmail.com --- Looks to be fixed by https://source.winehq.org/git/wine.git/commitdiff/5d282ec64d1ad815586adcd57f...
https://bugs.winehq.org/show_bug.cgi?id=39051
Eric Mullins wine@goabq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #15 from Eric Mullins wine@goabq.org --- (In reply to Mathew Hodson from comment #14)
Looks to be fixed by https://source.winehq.org/git/wine.git/commitdiff/ 5d282ec64d1ad815586adcd57ff494b524ed1064
Yep. Works for testcase and app.
https://bugs.winehq.org/show_bug.cgi?id=39051
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |5d282ec64d1ad815586adcd57ff | |494b524ed1064
https://bugs.winehq.org/show_bug.cgi?id=39051
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #16 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.18.
https://bugs.winehq.org/show_bug.cgi?id=39051
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |3.0.x
https://bugs.winehq.org/show_bug.cgi?id=39051
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|3.0.x |---
--- Comment #17 from Michael Stefaniuc mstefani@winehq.org --- Removing the 3.0.x milestone from bug fixes included in 3.0.5.