[pango/pango2: 112/168] hbface: work harder on the description




commit 4224709d898a380cad2907976da6d4e01f974ef6
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 14 21:15:45 2022 -0400

    hbface: work harder on the description
    
    Avoid changing the family name unintentionally.

 pango/pango-hbface.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/pango/pango-hbface.c b/pango/pango-hbface.c
index 937c22cd..90459aa3 100644
--- a/pango/pango-hbface.c
+++ b/pango/pango-hbface.c
@@ -171,12 +171,21 @@ set_name_and_description (PangoHbFace                *self,
                              family, sizeof (family));
       fullname = g_strconcat (family, " ", face->name, NULL);
 
+      /* This is an attempt to parse style/weight/variant information
+       * out of the face name. FIXME: we should look at variation
+       * coordinates too, here, instead of these guessing games.
+       */
       face->description = pango_font_description_from_string (fullname);
       pango_font_description_unset_fields (face->description,
                                            PANGO_FONT_MASK_VARIANT |
                                            PANGO_FONT_MASK_VARIATIONS |
                                            PANGO_FONT_MASK_GRAVITY);
 
+      /* Make sure we don't leave any leftovers misinterpreted
+       * as part of the family name.
+       */
+      pango_font_description_set_family (face->description, family);
+
       g_free (fullname);
     }
 


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