https://bugs.winehq.org/show_bug.cgi?id=45698
David Kahurani k.kahurani@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |k.kahurani@gmail.com
--- Comment #2 from David Kahurani k.kahurani@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.