https://bugs.winehq.org/show_bug.cgi?id=54962
Bug ID: 54962 Summary: GDI+ text rendering does not handle carriage returns Product: Wine Version: 8.8 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: trivial Priority: P2 Component: gdiplus Assignee: wine-bugs@winehq.org Reporter: klightspeed@netspace.net.au Distribution: ---
Created attachment 74489 --> https://bugs.winehq.org/attachment.cgi?id=74489 C++ program reproducing issue
gdip_format_string does not currently handle CR-LF sequences in text to be drawn. This results in boxes being rendered on the end of each line rendered by e.g. Graphics::DrawString when the string contains CR-LF (\r\n) newlines.
Comparing to the behaviour on Windows, it appears that Windows renders carriage returns as zero-width characters.
Comparing the values filled into the lpnDx parameter to GetTextExtentExPointW, Windows gives the characters '\r', '\n', and '\t' a width of 0, while wine gives them the same width as any other unknown character.
Windows: Character offsets: "H" (12) "e" (21) "l" (24) "l" (27) "o" (36) "\u000d" (36) "\u000a" (36) "W" (51) "o" (60) "r" (65) "l" (68) "d" (77)
wine: Character offsets: "H" (12) "e" (21) "l" (25) "l" (29) "o" (38) "\u000d" (43) "\u000a" (48) "W" (63) "o" (72) "r" (77) "l" (81) "d" (90)
https://bugs.winehq.org/show_bug.cgi?id=54962
--- Comment #1 from Ben Peddell klightspeed@netspace.net.au --- Created attachment 74490 --> https://bugs.winehq.org/attachment.cgi?id=74490 Output on Windows 10
https://bugs.winehq.org/show_bug.cgi?id=54962
--- Comment #2 from Ben Peddell klightspeed@netspace.net.au --- Created attachment 74491 --> https://bugs.winehq.org/attachment.cgi?id=74491 Output under wine 8.8
https://bugs.winehq.org/show_bug.cgi?id=54962
David Kahurani k.kahurani@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |k.kahurani@gmail.com
--- Comment #3 from David Kahurani k.kahurani@gmail.com --- I have submitted a possible fix to this issue:
https://gitlab.winehq.org/wine/wine/-/merge_requests/2865
I have tested with your test project/program and it seems to resolve the issue you were having.
This issue can be solved without concerning ourselves with the issue in GetTextExtentExPointW but, of course, that should be a different bug. In fact, this second bug will affect the functioning of gdip_format_string so that it tries to write strings containing only whitespace characters.
Thanks for the report.
https://bugs.winehq.org/show_bug.cgi?id=54962
Bartosz gang65@poczta.onet.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gang65@poczta.onet.pl, | |madewokherd@gmail.com
--- Comment #4 from Bartosz gang65@poczta.onet.pl --- Th
https://bugs.winehq.org/show_bug.cgi?id=54962
--- Comment #5 from Bartosz gang65@poczta.onet.pl --- The issue is already resolved. Confirmed with Wine 8.20.
It could be closed as fixed.
https://bugs.winehq.org/show_bug.cgi?id=54962
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #6 from Esme Povirk madewokherd@gmail.com --- Reported fixed.
https://bugs.winehq.org/show_bug.cgi?id=54962
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.21.