[cairo-commit] cairo/src cairo-ft-font.c, 1.75, 1.76 cairo-xlib-screen.c, 1.2, 1.3

Owen Taylor commit at pdx.freedesktop.org
Sun Jul 24 05:18:18 PDT 2005


Committed by: otaylor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv5008/src

Modified Files:
	cairo-ft-font.c cairo-xlib-screen.c 
Log Message:
2005-07-24  Owen Taylor  <otaylor at redhat.com>

        * src/cairo-ft-font.c (_render_glyph_outline): Fix size of allocated buffer
        for vertical subpixel rendering. (Reported by Fryderyk Dziarmagowski,
        http://bugzilla.gnome.org/show_bug.cgi?id=310935)
        (_get_pattern_load_flags): Fix a problem where we were OR'ing multiple
        FT_LOAD_* flags together.

        * src/cairo-xlib-screen.c (_cairo_xlib_init_screen_font_options): Fix
        reversed check for subpixel or not.


Index: cairo-ft-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ft-font.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- cairo-ft-font.c	23 Jul 2005 16:36:00 -0000	1.75
+++ cairo-ft-font.c	24 Jul 2005 12:18:16 -0000	1.76
@@ -899,7 +899,7 @@
 	bitmap.pitch = stride;   
 	bitmap.width = width * hmul;
 	bitmap.rows = height * vmul;
-	bitmap.buffer = calloc (1, stride * height);
+	bitmap.buffer = calloc (1, stride * bitmap.rows);
 	
 	if (bitmap.buffer == NULL) {
 	    return CAIRO_STATUS_NO_MEMORY;
@@ -1219,6 +1219,7 @@
     int hintstyle;
 #endif    
     int load_flags = 0;
+    int target_flags = 0;
 
     /* disable antialiasing if requested */
     if (FcPatternGetBool (pattern,
@@ -1246,20 +1247,20 @@
 	switch (hintstyle) {
 	case FC_HINT_SLIGHT:
 	case FC_HINT_MEDIUM:
-	    load_flags |= FT_LOAD_TARGET_LIGHT;
+	    target_flags = FT_LOAD_TARGET_LIGHT;
 	    break;
 	default:
-	    load_flags |= FT_LOAD_TARGET_NORMAL;
+	    target_flags = FT_LOAD_TARGET_NORMAL;
 	    break;
 	}
     } else {
 #ifdef FT_LOAD_TARGET_MONO
-	load_flags |= FT_LOAD_TARGET_MONO;
+	target_flags = FT_LOAD_TARGET_MONO;
 #endif	
     }
 #else /* !FC_HINT_STYLE */
     if (!hinting)
-	load_flags |= FT_LOAD_NO_HINTING;
+	target_flags = FT_LOAD_NO_HINTING;
 #endif /* FC_FHINT_STYLE */
 
     if (FcPatternGetInteger (pattern,
@@ -1273,13 +1274,15 @@
 	break;
     case FC_RGBA_RGB:
     case FC_RGBA_BGR:
-	load_flags |= FT_LOAD_TARGET_LCD;
+	target_flags = FT_LOAD_TARGET_LCD;
 	break;
     case FC_RGBA_VRGB:
     case FC_RGBA_VBGR:
-	load_flags |= FT_LOAD_TARGET_LCD_V;
+	target_flags = FT_LOAD_TARGET_LCD_V;
 	break;
     }
+
+    load_flags |= target_flags;
     
     /* force autohinting if requested */
     if (FcPatternGetBool (pattern,
@@ -1307,7 +1310,10 @@
     /* disable antialiasing if requested */
     switch (options->antialias) {
     case CAIRO_ANTIALIAS_NONE:
+#ifdef FT_LOAD_TARGET_MONO
 	load_flags |= FT_LOAD_TARGET_MONO;
+#endif
+	load_flags |= FT_LOAD_MONOCHROME;
 	break;
     case CAIRO_ANTIALIAS_SUBPIXEL:
 	switch (options->subpixel_order) {

Index: cairo-xlib-screen.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-screen.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cairo-xlib-screen.c	23 Jul 2005 12:37:23 -0000	1.2
+++ cairo-xlib-screen.c	24 Jul 2005 12:18:16 -0000	1.3
@@ -229,7 +229,7 @@
     }
 
     if (xft_antialias) {
-	if (subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT)
+	if (subpixel_order == CAIRO_SUBPIXEL_ORDER_DEFAULT)
 	    antialias = CAIRO_ANTIALIAS_GRAY;
 	else
 	    antialias = CAIRO_ANTIALIAS_SUBPIXEL;




More information about the cairo-commit mailing list