[pango/pango2-color-palette: 3/4] Unset faceid when looking for monospace
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango2-color-palette: 3/4] Unset faceid when looking for monospace
- Date: Sat, 2 Jul 2022 17:14:44 +0000 (UTC)
commit 656f7f798c7a5359d7809b4a9133737e2009641a
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 326c2def8..1bac38dec 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]