From 08957c21aed90e45ae75d2f8d3bb42eddad5fa08 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 22 Jun 2022 11:20:22 -0400 Subject: fontset: Ignore gravity and variations Ignore gravity and variations when matching in generic families, since the hb families contained in there don't have those fields in their descriptions. This fixes display of Chinese examples in pango-view. --- pango/pango-fontset-cached.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pango/pango-fontset-cached.c b/pango/pango-fontset-cached.c index adbc4409..2692ac24 100644 --- a/pango/pango-fontset-cached.c +++ b/pango/pango-fontset-cached.c @@ -109,16 +109,20 @@ pango_fontset_cached_get_font (PangoFontset *fontset, else if (PANGO_IS_GENERIC_FAMILY (item)) { PangoGenericFamily *family = PANGO_GENERIC_FAMILY (item); + PangoFontDescription *copy; PangoFontFace *face; /* Here is where we implement delayed picking for generic families. * If a face does not cover the character and its family is generic, * choose a different face from the same family and create a font to use. */ - face = pango_generic_family_find_face (family, - self->description, - self->language, - wc); + copy = pango_font_description_copy_static (self->description); + pango_font_description_unset_fields (copy, PANGO_FONT_MASK_VARIATIONS | + PANGO_FONT_MASK_GRAVITY | + PANGO_FONT_MASK_VARIANT); + face = pango_generic_family_find_face (family, copy, self->language, wc); + pango_font_description_free (copy); + if (face) { PangoFont *font; -- cgit v1.2.1