[Bug 45698] New: Gdiplus::GraphicsPath:: AddString does trim multi line string
https://bugs.winehq.org/show_bug.cgi?id=45698 Bug ID: 45698 Summary: Gdiplus::GraphicsPath::AddString does trim multi line string Product: Wine Version: 3.14 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdiplus Assignee: wine-bugs(a)winehq.org Reporter: nikolaysemenkov(a)gmail.com Distribution: --- The call Gdiplus::GraphicsPath::AddString(wszText, nText, &fontFamily, Style, fSize, ptOrigin, &textFormat) Arguments: wszText: "12345 7890122 3456" nText: 18, wszfontFamily: "FreeMono", Style: 0, fSize: 18.000000, ptOrigin: 0.000000,0.000000, textFormat: Constructed without arguments The issue is Rendered Output is truncated: "12345 78" No issue on native windows. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 --- Comment #1 from Nikolay Sivov <bunglehead(a)gmail.com> --- Please attach complete test program sources, and a binary. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 Fabian Maurer <dark.shadow4(a)web.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4(a)web.de -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 David Kahurani <k.kahurani(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |k.kahurani(a)gmail.com --- Comment #2 from David Kahurani <k.kahurani(a)gmail.com> --- I think I can reproduce this issue, though, not precisely like the OP described. Outlines of the strings added to a path like the OP described are almost always not drawn correctly. They are, however, rarely drawn correctly. With the code(please excuse my window management hacking) #include <windows.h> #include <gdiplus.h> #include <cstdio> using namespace Gdiplus; int main(int argc, char *argv[]) { HWND hwnd; struct GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; WNDCLASSA properties; memset(&properties, 0, sizeof(properties)); properties.lpszClassName = "AddString"; properties.lpfnWndProc = DefWindowProcA; properties.hInstance = GetModuleHandleA(0); properties.hbrBackground = (HBRUSH)CreateSolidBrush(RGB(0, 0, 0)); RegisterClassA( &properties ); hwnd = CreateWindowA( "AddString", "AddString test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, 0, 0, GetModuleHandleA(0), 0 ); gdiplusStartupInput.GdiplusVersion = 1; gdiplusStartupInput.DebugEventCallback = NULL; gdiplusStartupInput.SuppressBackgroundThread = 0; gdiplusStartupInput.SuppressExternalCodecs = 0; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); HDC hdc = GetDC(hwnd); Graphics graphics(hdc); FontFamily fontFamily(L"Times New Roman"); GraphicsPath pathstring, pathrect; StringFormat format = {}; Status status = pathstring.AddString(L"Hello World", -1, &fontFamily, 0, 48, PointF(100.0f, 100.0f), &format); Pen pen(Color(255, 255, 255, 0)); graphics.DrawPath(&pen, &pathstring); Sleep(100000); return 0; } I get the attached screenshot, sometimes just the letters 'Hel', sometimes, 'Hello' etc. I just fails randomly(though the return code is always success). I tried tracking down the issue and noticed this happens when the method static BOOL polyline( HDC hdc, const POINT *points, ULONG count ), is called repeatedly. At some point in the later runs, it breaks, though, I haven't witnessed it break in the first runs. And, for instance, if you have only one character in the added strings, it's outline is always rendered correctly. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 --- Comment #3 from David Kahurani <k.kahurani(a)gmail.com> --- Created attachment 73887 --> https://bugs.winehq.org/attachment.cgi?id=73887 Screenshot -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 --- Comment #4 from David Kahurani <k.kahurani(a)gmail.com> --- Created attachment 73888 --> https://bugs.winehq.org/attachment.cgi?id=73888 Reproducer -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 --- Comment #5 from David Kahurani <k.kahurani(a)gmail.com> --- Created attachment 73889 --> https://bugs.winehq.org/attachment.cgi?id=73889 Executable -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 --- Comment #6 from David Kahurani <k.kahurani(a)gmail.com> --- I finally reproduced the exact issue so, yes, clearly, the methods are choking on newlines. I guess we have two bugs here :-) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 --- Comment #7 from David Kahurani <k.kahurani(a)gmail.com> --- (In reply to David Kahurani from comment #2)
I get the attached screenshot, sometimes just the letters 'Hel', sometimes, 'Hello' etc. I just fails randomly(though the return code is always success).
I tried tracking down the issue and noticed this happens when the method static BOOL polyline( HDC hdc, const POINT *points, ULONG count ), is called repeatedly. At some point in the later runs, it breaks, though, I haven't witnessed it break in the first runs. And, for instance, if you have only one character in the added strings, it's outline is always rendered correctly.
Uuuh, this mostly just needs a call to UpdateWindow :-) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=45698 Esme Povirk <madewokherd(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
wine-bugs@winehq.org -
WineHQ Bugzilla