[pango/pango2-windows: 1/7] pangodwrite-fontmap.cpp: Make hb_face from DirectWrite immutable




commit 7d249a81c3951aca90071e7c3e6bc820aca6607a
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jun 15 12:10:13 2022 +0800

    pangodwrite-fontmap.cpp: Make hb_face from DirectWrite immutable
    
    The hb_face_t object that we get from HarfBuzz with the
    DirectWriteFontFace object that we have may not be immutable, so make it
    immutable if that is the case.

 pango/pangodwrite-fontmap.cpp | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/pango/pangodwrite-fontmap.cpp b/pango/pangodwrite-fontmap.cpp
index 9a274904..f55b00a3 100644
--- a/pango/pangodwrite-fontmap.cpp
+++ b/pango/pangodwrite-fontmap.cpp
@@ -214,6 +214,9 @@ util_create_pango_hb_face (IDWriteFontFamily *family,
       hb_face_t *hb_face = hb_directwrite_face_create (face);
       char *name = g_strconcat (family_name, " ", variant_name, NULL);
 
+      if (!hb_face_is_immutable (hb_face))
+        hb_face_make_immutable (hb_face);
+
       pango_face = pango_hb_face_new_from_hb_face (hb_face, -1, name, description);
 
       g_free (name);


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