[cairo-commit] cairo/src cairo-ft-font.c,1.84,1.85

Billy Biggs commit at pdx.freedesktop.org
Sun Jul 31 11:19:49 PDT 2005


Committed by: vektor

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

Modified Files:
	cairo-ft-font.c 
Log Message:
	reviewed by: keithp

	* src/cairo-ft-font.c: (_ft_unscaled_font_set_scale): Support
	versions of freetype without exact FT_Bitmap_Size.x/y_ppem
	values by using the pixel width and height values instead.

	* configure.in: Add a check for FT_Bitmap_Size.y_ppem.


Index: cairo-ft-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ft-font.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- cairo-ft-font.c	29 Jul 2005 19:45:01 -0000	1.84
+++ cairo-ft-font.c	31 Jul 2005 18:19:47 -0000	1.85
@@ -528,7 +528,11 @@
 	pixel_width = pixel_height = 0;
 	
 	for (i = 0; i < unscaled->face->num_fixed_sizes; i++) {
+#if HAVE_FT_BITMAP_SIZE_Y_PPEM
 	    double size = unscaled->face->available_sizes[i].y_ppem / 64.;
+#else
+	    double size = unscaled->face->available_sizes[i].height;
+#endif
 	    double distance = fabs (size - sf.y_scale);
 	    
 	    if (distance <= min_distance) {
@@ -536,11 +540,13 @@
 		best_i = i;
 	    }
 	}
+#if HAVE_FT_BITMAP_SIZE_Y_PPEM
 	error = FT_Set_Char_Size (unscaled->face,
 				  unscaled->face->available_sizes[best_i].x_ppem,
 				  unscaled->face->available_sizes[best_i].y_ppem,
 				  0, 0);
-	if (error )
+	if (error)
+#endif
 	    error = FT_Set_Pixel_Sizes (unscaled->face,
 					unscaled->face->available_sizes[best_i].width,
 					unscaled->face->available_sizes[best_i].height);




More information about the cairo-commit mailing list