[cairo-commit] test/bitmap-font.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Aug 31 11:22:36 PDT 2006


 test/bitmap-font.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

New commits:
diff-tree 7ad6e941017e070bf7d93afba4de5c49cd1ff533 (from 7f6e901a236ed267d396310fc56fa6bde697bfa2)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Aug 31 14:21:51 2006 -0400

    [test] Use FcFreeTypeQuery

diff --git a/test/bitmap-font.c b/test/bitmap-font.c
index ef9bbb6..7e3c79e 100644
--- a/test/bitmap-font.c
+++ b/test/bitmap-font.c
@@ -31,6 +31,7 @@
 
 #include <cairo-ft.h>
 #include <fontconfig/fontconfig.h>
+#include <fontconfig/fcfreetype.h>
 
 #define FONT "6x13.pcf"
 #define TEXT_SIZE 13
@@ -52,6 +53,7 @@ draw (cairo_t *cr, int width, int height
     cairo_status_t status;
     const char *srcdir = getenv ("srcdir");
     char *filename;
+    int *face_count;
     struct stat stat_buf;
 
     if (! srcdir)
@@ -64,15 +66,13 @@ draw (cairo_t *cr, int width, int height
 	return CAIRO_TEST_FAILURE;
     }
 
-    pattern = FcPatternCreate ();
+    pattern = FcFreeTypeQuery (filename, 0, NULL, &face_count);
+    free (filename);
     if (! pattern) {
-	cairo_test_log ("FcPatternCreate failed.\n");
+	cairo_test_log ("FcFreeTypeQuery failed.\n");
 	return CAIRO_TEST_FAILURE;
     }
 
-    FcPatternAddString (pattern, FC_FILE, (unsigned char *) filename);
-    free (filename);
-    FcPatternAddInteger (pattern, FC_INDEX, 0);
     font_face = cairo_ft_font_face_create_for_pattern (pattern);
 
     status = cairo_font_face_status (font_face);


More information about the cairo-commit mailing list