Marcus Meissner : gdi32: Rebuild font hash after changing the matrix.

Alexandre Julliard julliard at winehq.org
Tue Oct 5 14:41:43 CDT 2010


Module: wine
Branch: stable
Commit: c30e4b8d6b1ef885776412ecf50fcb94e8bc7494
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c30e4b8d6b1ef885776412ecf50fcb94e8bc7494

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Tue Jul 20 00:17:10 2010 +0200

gdi32: Rebuild font hash after changing the matrix.
(cherry picked from commit 2f7ec73adde1a87f788eebcf66ec8dd16bf9109f)

---

 dlls/gdi32/freetype.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index ddb3d24..9d88211 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -3780,12 +3780,23 @@ found:
     if(!face->scalable) {
         /* Windows uses integer scaling factors for bitmap fonts */
         INT scale, scaled_height;
+        GdiFont *cachedfont;
 
         /* FIXME: rotation of bitmap fonts is ignored */
         height = abs(GDI_ROUND( (double)height * ret->font_desc.matrix.eM22 ));
         if (ret->aveWidth)
             ret->aveWidth = (double)ret->aveWidth * ret->font_desc.matrix.eM11;
         ret->font_desc.matrix.eM11 = ret->font_desc.matrix.eM22 = 1.0;
+        dcmat.eM11 = dcmat.eM22 = 1.0;
+        /* As we changed the matrix, we need to search the cache for the font again,
+         * otherwise we might explode the cache. */
+        if((cachedfont = find_in_cache(hfont, &lf, &dcmat, can_use_bitmap)) != NULL) {
+            TRACE("Found cached font after non-scalable matrix rescale!\n");
+            free_font( ret );
+            LeaveCriticalSection( &freetype_cs );
+            return cachedfont;
+        }
+        calc_hash(&ret->font_desc);
 
         if (height != 0) height = diff;
         height += face->size.height;




More information about the wine-cvs mailing list