diff --git a/src/fcfreetype.c b/src/fcfreetype.c index 2575a72..81ebda7 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -1277,20 +1277,29 @@ FcFreeTypeQueryFace (const FT_Face face, if (!pat) goto bail0; - if (!FcPatternAddBool (pat, FC_OUTLINE, - (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0)) - goto bail1; - - if (!FcPatternAddBool (pat, FC_SCALABLE, - (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0)) - goto bail1; + { + int has_outline = !!(face->face_flags & FT_FACE_FLAG_SCALABLE); + int has_color = 0; #ifdef FT_FACE_FLAG_COLOR - if (!FcPatternAddBool (pat, FC_COLOR, - (face->face_flags & FT_FACE_FLAG_COLOR) != 0)) - goto bail1; + has_color = !!(face->face_flags & FT_FACE_FLAG_COLOR); #endif + if (!FcPatternAddBool (pat, FC_OUTLINE, has_outline)) + goto bail1; + +#ifdef FT_FACE_FLAG_COLOR + if (!FcPatternAddBool (pat, FC_COLOR, has_color)) + goto bail1; +#endif + + /* All color fonts are designed to be scaled, even if they only have + * bitmap strikes. Client is responsible to scale the bitmaps. This + * is in constrast to non-color strikes... */ + if (!FcPatternAddBool (pat, FC_SCALABLE, has_outline || has_color)) + goto bail1; + } + /* * Get the OS/2 table