Fix FT_Get_Next_Char API to match official 2.0.9 released version

This commit is contained in:
Keith Packard 2002-03-27 04:33:55 +00:00
parent 8c7b2a9d83
commit d9db7b9e94
1 changed files with 18 additions and 8 deletions

View File

@ -812,7 +812,7 @@ FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c)
# define HAS_NEXT_CHAR # define HAS_NEXT_CHAR
# else # else
# if FREETYPE_MINOR == 0 # if FREETYPE_MINOR == 0
# if FREETYPE_PATCH >= 8 # if FREETYPE_PATCH >= 9
# define HAS_NEXT_CHAR # define HAS_NEXT_CHAR
# endif # endif
# endif # endif
@ -824,7 +824,10 @@ FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c)
* For our purposes, this approximation is sufficient * For our purposes, this approximation is sufficient
*/ */
#ifndef HAS_NEXT_CHAR #ifndef HAS_NEXT_CHAR
#define FT_Get_Next_Char(face, ucs4) ((ucs4) >= 0xffffff ? 0 : (ucs4) + 1) #define FT_Get_First_Char(face, gi) ((*(gi) = 1), 1)
#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"
#endif #endif
@ -1464,18 +1467,25 @@ FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks)
} }
else else
{ {
max = fcFontDecoders[o].max; FT_UInt gindex;
max = fcFontDecoders[o].max;
/* /*
* Find the first encoded character in the font * Find the first encoded character in the font
*/ */
ucs4 = 0;
if (FT_Get_Char_Index (face, 0)) if (FT_Get_Char_Index (face, 0))
{
ucs4 = 0; ucs4 = 0;
gindex = 1;
}
else else
ucs4 = FT_Get_Next_Char (face, 0); {
ucs4 = FT_Get_Next_Char (face, 0, &gindex);
if (!ucs4)
gindex = 0;
}
for (;;) while (gindex)
{ {
page = ucs4 >> 8; page = ucs4 >> 8;
leaf = 0; leaf = 0;
@ -1500,9 +1510,9 @@ FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks)
} }
ucs4++; ucs4++;
} }
ucs4 = FT_Get_Next_Char (face, ucs4 - 1); ucs4 = FT_Get_Next_Char (face, ucs4 - 1, &gindex);
if (!ucs4) if (!ucs4)
break; gindex = 0;
} }
#ifdef CHECK #ifdef CHECK
for (ucs4 = 0; ucs4 < 0x10000; ucs4++) for (ucs4 = 0; ucs4 < 0x10000; ucs4++)