[pango/pango2: 240/301] hbface: work harder on the description




commit 1ad01899e21ce9e1b9841740bc046a69d656b396
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 937c22cd9..90459aa3c 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]