Treat color fonts as scalable

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...

Clients can still use FC_OUTLINE to distinguish bitmap vs outline
fonts.  Previously FC_OUTLINE and FC_SCALABLE always had the same
value.  Now FC_SCALABLE is set to (FC_OUTLINE || FC_COLOR).

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=87122
This commit is contained in:
Behdad Esfahbod 2014-12-14 13:55:53 -08:00
parent dbc7c4a2cf
commit 66db69a6d9
1 changed files with 19 additions and 10 deletions

View File

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