[pango/pango2: 4/7] fontconfig: Be more careful with generic families
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango2: 4/7] fontconfig: Be more careful with generic families
- Date: Sat, 9 Jul 2022 16:08:26 +0000 (UTC)
commit 02a06423e31bcfb65ef314f01096a1de2d780654
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 9 11:37:31 2022 -0400
fontconfig: Be more careful with generic families
Actually skip non-monospace fonts for 'Monospace',
and skip color Emoji fonts when we're not assembling
the 'Emoji' alias.
pango2/pangofc-fontmap.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/pango2/pangofc-fontmap.c b/pango2/pangofc-fontmap.c
index d07cac5dd..f24430413 100644
--- a/pango2/pangofc-fontmap.c
+++ b/pango2/pangofc-fontmap.c
@@ -450,6 +450,7 @@ pango2_fc_font_map_populate (Pango2FontMap *map)
int index;
FcLangSet *langs;
int spacing;
+ gboolean color;
const char *family_name;
pat = ret->fonts[j];
@@ -460,16 +461,20 @@ pango2_fc_font_map_populate (Pango2FontMap *map)
if (FcPatternGetLangSet (pat, FC_LANG, 0, &langs) != FcResultMatch)
continue;
+ if (FcPatternGetBool (pat, FC_COLOR, 0, &color) != FcResultMatch)
+ color = FALSE;
+
if (FcLangSetEqual (langs, no_langs))
continue;
- if ((strcmp (generic_names[i], "emoji") == 0) != FcLangSetEqual (langs, emoji_langs))
+ /* No color Emoji here, please */
+ if (FcLangSetEqual (langs, emoji_langs) && color)
continue;
if (FcPatternGetInteger (pat, FC_SPACING, 0, &spacing) != FcResultMatch)
spacing = FC_PROPORTIONAL;
- if (strcmp (generic_names[i], "monospace") == 0 && spacing != FC_MONO)
+ if (strcmp (generic_names[i], "Monospace") == 0 && spacing != FC_MONO)
continue;
if (FcPatternGetString (pat, FC_FAMILY, 0, (FcChar8 **)(void*)&family_name) != FcResultMatch)
@@ -505,7 +510,6 @@ pango2_fc_font_map_populate (Pango2FontMap *map)
}
FcLangSetDestroy (no_langs);
- FcLangSetDestroy (emoji_langs);
FcObjectSetDestroy (os);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]