dlls/gdi: fix GetGlyphOutline(resend)

sx123456 sx123456 at yahoo.co.jp
Thu Feb 24 12:56:39 CST 2005


Sorry, I forgot the patch.


On Fri, 25 Feb 2005 03:48:06 +0900
TANABE Hiroshi <hirokun_dayomon at infoseek.to> wrote:

> On Tue, 22 Feb 2005 17:23:59 +0000
> Huw Davies <huw at codeweavers.com> wrote:
> 
> > Isn't this a bug in FreeType?  If we have to have this in Wine, could
> > you use the defines in wingdi.h instead of the '3' and the '9'?
> 
> PANOSE's proportion value does not identify truly fixed-width font.
> But MS-Windows probably uses the value to identify fixed-width font.
> I have changed to use the defines in wingdi.h.
> 
> 
> Changelog:
> Remove (buf && !buflen) checking.
> Fixed outline rendering with GGO_GRAY?_BITMAP option.
> Improved fixed-pitch fonts detection.
-------------- next part --------------
Index: dlls/gdi/freetype.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/freetype.c,v
retrieving revision 1.81
diff -u -r1.81 freetype.c
--- dlls/gdi/freetype.c	24 Jan 2005 19:00:10 -0000	1.81
+++ dlls/gdi/freetype.c	24 Feb 2005 18:43:56 -0000
@@ -2385,10 +2385,6 @@
     if(format == GGO_METRICS)
         return 1; /* FIXME */
 
-    if (buf && !buflen){
-        return GDI_ERROR;
-    }
-
     if(ft_face->glyph->format != ft_glyph_format_outline && format != GGO_BITMAP) {
         TRACE("loaded a bitmap\n");
 	return GDI_ERROR;
@@ -2467,14 +2463,16 @@
 
 	pFT_Outline_Translate(&ft_face->glyph->outline, -left, -bottom );
 
+	memset(ft_bitmap.buffer, 0, buflen);
+
 	pFT_Outline_Get_Bitmap(library, &ft_face->glyph->outline, &ft_bitmap);
 
 	if(format == GGO_GRAY2_BITMAP)
-	    mult = 5;
+	    mult = 4;
 	else if(format == GGO_GRAY4_BITMAP)
-	    mult = 17;
+	    mult = 16;
 	else if(format == GGO_GRAY8_BITMAP)
-	    mult = 65;
+	    mult = 64;
 	else if(format == WINE_GGO_GRAY16_BITMAP)
 	    break;
 	else {
@@ -2486,7 +2484,7 @@
 	for(row = 0; row < height; row++) {
 	    ptr = start;
 	    for(col = 0; col < width; col++, ptr++) {
-	        *ptr = (*(unsigned int*)ptr * mult + 128) / 256;
+	        *ptr = (((int)*ptr) * mult + 128) / 256;
 	    }
 	    start += pitch;
 	}
@@ -2903,7 +2901,9 @@
     TM.tmStruckOut = font->strikeout;
 
     /* Yes TPMF_FIXED_PITCH is correct; braindead api */
-    if(!FT_IS_FIXED_WIDTH(ft_face))
+    if(!FT_IS_FIXED_WIDTH(ft_face) &&
+       (pOS2->version == 0xFFFFU || 
+        pOS2->panose[PAN_PROPORTION_INDEX] != PAN_PROP_MONOSPACED))
         TM.tmPitchAndFamily = TMPF_FIXED_PITCH;
     else
         TM.tmPitchAndFamily = 0;


More information about the wine-patches mailing list