From 8033d11e7e8a7825bc1d8c40a2023495ca2f34f6 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 16 Jul 2008 18:08:24 -0700 Subject: [PATCH] gdi32: Glyph advances should be measured for unrotated characters. --- dlls/gdi32/freetype.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 62db9fe..2003b47 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -4300,6 +4300,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; double widthRatio = 1.0; FT_Matrix transMat = identityMat; + FT_Matrix transMatUnrotated; BOOL needsTransform = FALSE; BOOL tategaki = (font->GSUB_Table != NULL); UINT original_index; @@ -4404,6 +4405,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, } /* Rotation transform */ + transMatUnrotated = transMat; if(font->orientation && !tategaki) { FT_Matrix rotationMat; FT_Vector vecAngle; @@ -4439,6 +4441,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, extraMat.yx = FT_FixedFromFIXED(lpmat->eM12); extraMat.yy = FT_FixedFromFIXED(lpmat->eM22); pFT_Matrix_Multiply(&extraMat, &transMat); + pFT_Matrix_Multiply(&extraMat, &transMatUnrotated); needsTransform = TRUE; } @@ -4479,8 +4482,13 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, vec.x = ft_face->glyph->metrics.horiAdvance; vec.y = 0; pFT_Vector_Transform(&vec, &transMat); - adv = lpgm->gmCellIncX = (vec.x+63) >> 6; + lpgm->gmCellIncX = (vec.x+63) >> 6; lpgm->gmCellIncY = -((vec.y+63) >> 6); + + vec.x = ft_face->glyph->metrics.horiAdvance; + vec.y = 0; + pFT_Vector_Transform(&vec, &transMatUnrotated); + adv = (vec.x+63) >> 6; } lpgm->gmBlackBoxX = (right - left) >> 6; lpgm->gmBlackBoxY = (top - bottom) >> 6; -- 1.5.4.5