[pango/simple-fontmap: 11/12] pango-view: Add a monospace font




commit 1c0792dd3d5fdad30147e6d461488e4e4cc4267e
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 24 16:42:32 2021 -0700

    pango-view: Add a monospace font
    
    This is hack to test hex boxes, which rely on
    having a Monospace alias.

 utils/viewer-pangocairo.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c
index ef90c6aa..9b1f1f07 100644
--- a/utils/viewer-pangocairo.c
+++ b/utils/viewer-pangocairo.c
@@ -73,6 +73,17 @@ pangocairo_view_create (const PangoViewer *klass G_GNUC_UNUSED)
           pango_simple_font_map_add_face (PANGO_SIMPLE_FONT_MAP (instance->fontmap), slanted);
           g_object_unref (slanted);
         }
+
+      fam = pango_font_map_get_family (instance->fontmap, "Liberation Mono");
+      if (fam)
+        {
+          PangoFontFace *face = pango_font_family_get_face (fam, "Regular");
+          PangoHbFace *alias;
+
+          alias = pango_hb_face_new_alias (PANGO_HB_FACE (face), "Monospace");
+          pango_simple_font_map_add_face (PANGO_SIMPLE_FONT_MAP (instance->fontmap), alias);
+          g_object_unref (alias);
+        }
     }
   else
     {


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