fonts: move char_extra calculation

Huw D M Davies h.davies1 at physics.ox.ac.uk
Mon Nov 10 11:54:49 CST 2003


        Huw Davies <huw at codeweavers.com>
	GetTextExtentPoint should include an inter character spacing set by
	SetTextCharacterExtra.        
-- 
Huw Davies
huw at codeweavers.com
Index: objects/font.c
===================================================================
RCS file: /home/wine/wine/objects/font.c,v
retrieving revision 1.107
diff -u -r1.107 font.c
--- objects/font.c	15 Oct 2003 03:32:31 -0000	1.107
+++ objects/font.c	10 Nov 2003 17:52:24 -0000
@@ -974,6 +974,7 @@
         ret = WineEngGetTextExtentPoint(dc->gdiFont, str, count, size);
 	size->cx = abs(INTERNAL_XDSTOWS(dc, size->cx));
 	size->cy = abs(INTERNAL_YDSTOWS(dc, size->cy));
+        size->cx += count * dc->charExtra;
     }
     else if(dc->funcs->pGetTextExtentPoint)
         ret = dc->funcs->pGetTextExtentPoint( dc->physDev, str, count, size );
@@ -1008,6 +1009,7 @@
         ret = WineEngGetTextExtentPointI(dc->gdiFont, indices, count, size);
 	size->cx = abs(INTERNAL_XDSTOWS(dc, size->cx));
 	size->cy = abs(INTERNAL_YDSTOWS(dc, size->cy));
+        size->cx += count * dc->charExtra;
     }
     else if(dc->funcs->pGetTextExtentPoint) {
         FIXME("calling GetTextExtentPoint\n");
Index: dlls/x11drv/xrender.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/xrender.c,v
retrieving revision 1.24
diff -u -r1.24 xrender.c
--- dlls/x11drv/xrender.c	24 Oct 2003 00:29:43 -0000	1.24
+++ dlls/x11drv/xrender.c	10 Nov 2003 17:52:24 -0000
@@ -1047,12 +1047,11 @@
 	SIZE tmpsz;
         deltas = HeapAlloc(GetProcessHeap(), 0, count * sizeof(INT));
 	for(i = 0; i < count; i++) {
-	    deltas[i] = char_extra;
 	    if(lpDx)
-	        deltas[i] += lpDx[i];
+	        deltas[i] = lpDx[i] + char_extra;
 	    else {
 	        GetTextExtentPointI(hdc, glyphs + i, 1, &tmpsz);
-		deltas[i] += tmpsz.cx;
+		deltas[i] = tmpsz.cx;
 	    }
 	}
     } else if(lpDx)



More information about the wine-patches mailing list