diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-06-22 11:20:22 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-07-04 11:17:21 -0400 |
commit | 24a66f109ea33db50d566710ed061065268a2d48 (patch) | |
tree | 7ca63e9bd93bcc87193b131227131458fa4accd7 | |
parent | aa0639a32d34d80a005f6f1831f6bf21e007fb75 (diff) | |
download | pango-24a66f109ea33db50d566710ed061065268a2d48.tar.gz |
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.
-rw-r--r-- | pango/pango-fontset-cached.c | 12 |
1 files 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; |