From cfc50b28870ca026c002cbd41780530c9af15753 Mon Sep 17 00:00:00 2001 From: David Kahurani Date: Sun, 23 Jul 2023 10:11:48 +0300 Subject: [PATCH] gdiplus/font: Fix GdipGetLogFontW/A with gdi_transform. Signed-off-by: David Kahurani --- 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); -- 2.11.4.GIT