summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-09 15:38:29 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-07-09 15:38:29 +0000
commit77146b66f2307180934ef8d327aaab0bfe69bb35 (patch)
tree085ef4e7d543732a805d8998c93213a4432624fa
parent94988869c360d0b6ee9dc2e55b4179d2fd6920e6 (diff)
parent17a5ef13fd5052ab2c640b192f0e8e5bf30b617a (diff)
downloadpango-77146b66f2307180934ef8d327aaab0bfe69bb35.tar.gz
Merge branch 'woff-off' into 'master'
fontconfig: Ignore woff fonts See merge request GNOME/pango!366
-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.