]> git.wh0rd.org - fontconfig.git/commitdiff
Add FcResultOutOfMemory to provide an accurate error when FcFontSetMatch
authorKeith Packard <keithp@keithp.com>
Sat, 29 May 2004 19:32:41 +0000 (19:32 +0000)
committerKeith Packard <keithp@keithp.com>
Sat, 29 May 2004 19:32:41 +0000 (19:32 +0000)
    fails in this way
Make #warning about lacking various FreeType features indicate which
    version those features appeared so users know how to fix the problem
    (Thanks to Anton Tropashko)

ChangeLog
fontconfig/fontconfig.h
src/fcfreetype.c
src/fcmatch.c

index 1b4ebcbe51c87197ae7459606bbd70c5d2e628c5..756bffc90467b2a117647264f8fb330fd7b507d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-05-29  Keith Packard  <keithp@keithp.com>
+
+       * fontconfig/fontconfig.h:
+       * src/fcmatch.c: (FcFontSetMatch):
+       Add FcResultOutOfMemory to provide an accurate error when
+       FcFontSetMatch fails in this way
+       
+       * src/fcfreetype.c:
+       Make #warning about lacking various FreeType features indicate
+       which version those features appeared so users know how to
+       fix the problem (Thanks to Anton Tropashko)
+
 2004-05-05  Keith Packard  <keithp@keithp.com>
 
        * src/fcfreetype.c: (FcFreeTypeCharSetAndSpacing):
index 7ff6e97775f59c3af90168c94e7761da40ed733e..225ce7588e89540ba8ad7cd67fb07c3e5d630170 100644 (file)
@@ -185,7 +185,8 @@ typedef struct _FcConstant {
 } FcConstant;
 
 typedef enum _FcResult {
-    FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId
+    FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
+    FcResultOutOfMemory,
 } FcResult;
 
 typedef struct _FcPattern   FcPattern;
index 6e4709f1a6c961c4e7cdc4cee81605e7e1da8cd7..daaba28bbb4ff8ee9ead029c7641632e39a14329 100644 (file)
 #endif
 
 #if !HAVE_FT_GET_BDF_PROPERTY
-#warning "No FT_Get_BDF_Property"
+#warning "No FT_Get_BDF_Property: Please install freetype 2.1.4 or later"
 #endif
 
 #if !HAVE_FT_GET_PS_FONT_INFO
-#warning "No FT_Get_Font_Info"
+#warning "No FT_Get_PS_Font_Info: Please install freetype 2.1.1 or later"
 #endif
 
 /*
@@ -1094,7 +1094,7 @@ bail:
 #define FT_Get_Next_Char(face, ucs4, gi) ((ucs4) >= 0xffffff ? \
                                          (*(gi) = 0), 0 : \
                                          (*(gi) = 1), (ucs4) + 1)
-#warning "No FT_Get_Next_Char"
+#warning "No FT_Get_Next_Char: Please install freetype version 2.1.0 or newer"
 #endif
 
 typedef struct _FcCharEnt {
index 4bb3d46d5e5b17888294f8de5d2b4c27887877b5..2e9017c52866aa135c78faa2a0f507663b25c4d4 100644 (file)
@@ -493,7 +493,10 @@ FcFontSetMatch (FcConfig    *config,
     {
        config = FcConfigGetCurrent ();
        if (!config)
+       {
+           *result = FcResultOutOfMemory;
            return 0;
+       }
     }
     for (set = 0; set < nsets; set++)
     {