Simplify some more
This commit is contained in:
parent
9c99baba66
commit
d997d7c770
|
@ -1986,16 +1986,12 @@ bail:
|
||||||
#warning "No FT_Get_Next_Char: Please install freetype version 2.1.0 or newer"
|
#warning "No FT_Get_Next_Char: Please install freetype version 2.1.0 or newer"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _FcFontDecode {
|
static const FT_Encoding fcFontEncodings[] = {
|
||||||
FT_Encoding encoding;
|
FT_ENCODING_UNICODE,
|
||||||
} FcFontDecode;
|
FT_ENCODING_MS_SYMBOL
|
||||||
|
|
||||||
static const FcFontDecode fcFontDecoders[] = {
|
|
||||||
{ ft_encoding_unicode },
|
|
||||||
{ ft_encoding_symbol },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_DECODE (int) (sizeof (fcFontDecoders) / sizeof (fcFontDecoders[0]))
|
#define NUM_DECODE (int) (sizeof (fcFontEncodings) / sizeof (fcFontEncodings[0]))
|
||||||
|
|
||||||
static const FcChar32 prefer_unicode[] = {
|
static const FcChar32 prefer_unicode[] = {
|
||||||
0x20ac, /* EURO SIGN */
|
0x20ac, /* EURO SIGN */
|
||||||
|
@ -2140,7 +2136,7 @@ FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4)
|
||||||
if (face->charmap)
|
if (face->charmap)
|
||||||
{
|
{
|
||||||
for (; initial < NUM_DECODE; initial++)
|
for (; initial < NUM_DECODE; initial++)
|
||||||
if (fcFontDecoders[initial].encoding == face->charmap->encoding)
|
if (fcFontEncodings[initial] == face->charmap->encoding)
|
||||||
break;
|
break;
|
||||||
if (initial == NUM_DECODE)
|
if (initial == NUM_DECODE)
|
||||||
initial = 0;
|
initial = 0;
|
||||||
|
@ -2151,8 +2147,8 @@ FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4)
|
||||||
for (offset = 0; offset < NUM_DECODE; offset++)
|
for (offset = 0; offset < NUM_DECODE; offset++)
|
||||||
{
|
{
|
||||||
decode = (initial + offset) % NUM_DECODE;
|
decode = (initial + offset) % NUM_DECODE;
|
||||||
if (!face->charmap || face->charmap->encoding != fcFontDecoders[decode].encoding)
|
if (!face->charmap || face->charmap->encoding != fcFontEncodings[decode])
|
||||||
if (FT_Select_Charmap (face, fcFontDecoders[decode].encoding) != 0)
|
if (FT_Select_Charmap (face, fcFontEncodings[decode]) != 0)
|
||||||
continue;
|
continue;
|
||||||
glyphindex = FT_Get_Char_Index (face, (FT_ULong) ucs4);
|
glyphindex = FT_Get_Char_Index (face, (FT_ULong) ucs4);
|
||||||
if (glyphindex)
|
if (glyphindex)
|
||||||
|
@ -2270,7 +2266,7 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing
|
||||||
#endif
|
#endif
|
||||||
for (o = 0; o < NUM_DECODE; o++)
|
for (o = 0; o < NUM_DECODE; o++)
|
||||||
{
|
{
|
||||||
if (FT_Select_Charmap (face, fcFontDecoders[o].encoding) != 0)
|
if (FT_Select_Charmap (face, fcFontEncodings[o]) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue