[PATCH v2 0/1] MR3387: gdiplus/font: Fix GdipGetLogFontW/A with gdi_transform
These APIs should take into consideration the gdi_transform when calculating font properties Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> -- v2: gdiplus/font: Fix GdipGetLogFontW/A with gdi_transform https://gitlab.winehq.org/wine/wine/-/merge_requests/3387
From: David Kahurani <k.kahurani(a)gmail.com> Signed-off-by: David Kahurani <k.kahurani(a)gmail.com> --- dlls/gdiplus/font.c | 2 ++ dlls/gdiplus/tests/font.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 8b85f567aab..024d27c1ce7 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -485,6 +485,8 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, LOGFONTW pt[1].Y = 0.0; pt[2].X = 0.0; pt[2].Y = 1.0; + + GdipMultiplyMatrix(&matrix, &graphics->gdi_transform, MatrixOrderAppend); GdipTransformMatrixPoints(&matrix, pt, 3); angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); rel_height = sqrt((pt[2].Y - pt[0].Y) * (pt[2].Y - pt[0].Y)+ diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index a2aea904bb1..30cf159e140 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -1239,6 +1239,20 @@ static void test_font_transform(void) todo_wine expectf_(1532.984985, bounds.Height, 0.05); + GdipDeleteGraphics(graphics); + + SetMapMode( hdc, MM_ISOTROPIC); + SetWindowExtEx(hdc, 200, 200, NULL); + SetViewportExtEx(hdc, 100, 100, NULL); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + status = GdipGetLogFontA(font, graphics, &lf); + expect(Ok, status); + expect(-50, lf.lfHeight); + expect(0, lf.lfWidth); + expect(0, lf.lfEscapement); + expect(0, lf.lfOrientation); + GdipDeleteMatrix(matrix); GdipDeleteFont(font); GdipDeleteGraphics(graphics); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3387
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details: The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=135129 Your paranoid android. === debian11b (64 bit WoW report) === win32u: win32u.c:1057: Test failed: buf = win32u:win32u:02dc done (0) in 0s 1374B
This merge request was approved by Esme Povirk. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3387
participants (4)
-
David Kahurani -
David Kahurani (@kahurani) -
Esme Povirk (@madewokherd) -
Marvin