From ec0c740e392e6e05ae0fa204ebe191cbe27073cf Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 29 May 2004 19:32:41 +0000 Subject: [PATCH] Add FcResultOutOfMemory to provide an accurate error when FcFontSetMatch 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 | 12 ++++++++++++ fontconfig/fontconfig.h | 3 ++- src/fcfreetype.c | 6 +++--- src/fcmatch.c | 3 +++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b4ebcb..756bffc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-05-29 Keith Packard + + * 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 * src/fcfreetype.c: (FcFreeTypeCharSetAndSpacing): diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h index 7ff6e97..225ce75 100644 --- a/fontconfig/fontconfig.h +++ b/fontconfig/fontconfig.h @@ -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; diff --git a/src/fcfreetype.c b/src/fcfreetype.c index 6e4709f..daaba28 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -67,11 +67,11 @@ #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 { diff --git a/src/fcmatch.c b/src/fcmatch.c index 4bb3d46..2e9017c 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -493,7 +493,10 @@ FcFontSetMatch (FcConfig *config, { config = FcConfigGetCurrent (); if (!config) + { + *result = FcResultOutOfMemory; return 0; + } } for (set = 0; set < nsets; set++) { -- 2.39.2