[pango/pango2-color-palette: 64/71] Unset faceid when looking for monospace




commit 0e95c6dca2839a8728def3b2131edcf2ad18087d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 2 09:53:19 2022 -0400

    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.

 pango2/pango-hbfont.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/pango2/pango-hbfont.c b/pango2/pango-hbfont.c
index a88762247..91f4a305f 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]