diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-07-02 09:53:19 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-07-04 11:24:16 -0400 |
commit | 0e95c6dca2839a8728def3b2131edcf2ad18087d (patch) | |
tree | 5ce0753ba8543d6104e7a9dc8735a7b88a88040b | |
parent | 887f11571709db4c3a2ab7fe005e1f77185661cf (diff) | |
download | pango-0e95c6dca2839a8728def3b2131edcf2ad18087d.tar.gz |
Unset faceid when looking for monospace
We want to keep the characteristics of the font,
but the faceid is pointless to keep, since we
are explicitly looking for monospace, not the
same face.
-rw-r--r-- | pango2/pango-hbfont.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pango2/pango-hbfont.c b/pango2/pango-hbfont.c index a8876224..91f4a305 100644 --- a/pango2/pango-hbfont.c +++ b/pango2/pango-hbfont.c @@ -366,7 +366,7 @@ create_hex_box_info (Pango2HbFont *self) */ /* We should rotate the box, not glyphs */ - pango2_font_description_unset_fields (desc, PANGO2_FONT_MASK_GRAVITY); + pango2_font_description_unset_fields (desc, PANGO2_FONT_MASK_GRAVITY|PANGO2_FONT_MASK_FACEID); pango2_font_description_set_family_static (desc, "monospace"); @@ -388,12 +388,11 @@ create_hex_box_info (Pango2HbFont *self) mini_font = pango2_font_map_load_font (map, context, desc); - g_object_unref (context); + get_max_char_size (mini_font, hexdigits, &width, &height); + g_object_unref (context); pango2_font_description_free (desc); - get_max_char_size (mini_font, hexdigits, &width, &height); - hb_font_get_extents_for_direction (hb_font, HB_DIRECTION_LTR, &font_extents); font_ascent = font_extents.ascender / (double) PANGO2_SCALE; font_descent = - font_extents.descender / (double) PANGO2_SCALE; |