summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-09 10:11:12 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-09 10:11:12 -0400
commit17a5ef13fd5052ab2c640b192f0e8e5bf30b617a (patch)
tree87e16a315ab1a721abc78a5d0a2a8741bbf3ffbe
parent1f104f1411c0cf0a5945d759936ba9dad7f33aef (diff)
downloadpango-woff-off.tar.gz
fontconfig: Ignore woff fontswoff-off
harfbuzz creates a face, but doesn't seem to find any glyphs in woff fonts, so filter them out. Sadly, fontfonfig does not have useful format information about this, so we need to crudely filter by filename.
-rw-r--r--pango/pangofc-fontmap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 7ea5dc52..aada1909 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -962,12 +962,20 @@ pango_fc_is_supported_font_format (FcPattern* pattern)
{
FcResult res;
const char *fontformat;
+ const char *file;
+
+ /* Harfbuzz loads woff fonts, but we don't get any glyphs */
+ res = FcPatternGetString (pattern, FC_FILE, 0, (FcChar8 **)(void*)&file);
+ if (res == FcResultMatch &&
+ (g_str_has_suffix (file, ".woff") ||
+ g_str_has_suffix (file, ".woff2")))
+ return FALSE;
res = FcPatternGetString (pattern, FC_FONTFORMAT, 0, (FcChar8 **)(void*)&fontformat);
if (res != FcResultMatch)
return FALSE;
- /* harfbuzz supports only SFNT fonts. */
+ /* Harfbuzz supports only SFNT fonts. */
/* FIXME: "CFF" is used for both CFF in OpenType and bare CFF files, but
* HarfBuzz does not support the later and FontConfig does not seem
* to have a way to tell them apart.