[pango/pango2: 111/178] hbface: work harder on the description
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango2: 111/178] hbface: work harder on the description
- Date: Wed, 22 Jun 2022 20:10:16 +0000 (UTC)
commit aee6b79e1ecb061616fed1dfe539d802a2b681f6
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]