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)
This commit is contained in:
Keith Packard 2004-05-29 19:32:41 +00:00
parent 55a69bd0ae
commit ec0c740e39
4 changed files with 20 additions and 4 deletions

View File

@ -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):

View 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;

View File

@ -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 {

View File

@ -493,7 +493,10 @@ FcFontSetMatch (FcConfig *config,
{
config = FcConfigGetCurrent ();
if (!config)
{
*result = FcResultOutOfMemory;
return 0;
}
}
for (set = 0; set < nsets; set++)
{