[pango/variation-coords: 3/3] fc: Set variation coords from pattern



commit bdc51e2b76f21d5e3002e761ea1891fb2447ffbc
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jul 25 08:26:21 2019 -0400

    fc: Set variation coords from pattern
    
    We need to call hb_font_set_var_coords, otherwise
    the hb_font_t has no coords.

 pango/pangofc-font.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 0bb25ba5..b6208583 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -971,7 +971,21 @@ pango_fc_font_create_hb_font (PangoFont *font)
                      size * PANGO_SCALE * y_scale);
   if (key)
     {
-      const char *variations = pango_fc_font_key_get_variations (key);
+      FcPattern *pattern = pango_fc_font_key_get_pattern (key);
+      const char *variations;
+
+      if (FcPatternGetString (pattern, PANGO_FC_FONT_VARIATIONS, 0, (FcChar8 **)&variations) == 
FcResultMatch)
+        {
+          guint n_variations;
+          hb_variation_t *hb_variations;
+
+          parse_variations (variations, &hb_variations, &n_variations);
+          hb_font_set_variations (hb_font, hb_variations, n_variations);
+
+          g_free (hb_variations);
+        }
+
+      variations = pango_fc_font_key_get_variations (key);
       if (variations)
         {
           guint n_variations;


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