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)