summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-06-22 11:20:22 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-06-22 13:57:26 -0400
commit08957c21aed90e45ae75d2f8d3bb42eddad5fa08 (patch)
tree32092fce81094c0f06ae754901b5531033c8c3d4
parentceb53e4cb96329e3e77e499df3162b22ec95bd9c (diff)
downloadpango-08957c21aed90e45ae75d2f8d3bb42eddad5fa08.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.c12
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;