[pango/synthetic-slant: 2/2] Pass synthetic slant to harfbuzz




commit 8baa4c28e0ec7042cac16540b90cec65f2ec6aee
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Sep 11 12:44:29 2021 -0400

    Pass synthetic slant to harfbuzz
    
    When our font matrix includes a synthetic slant,
    pass that information to harfbuzz, so it can adjust
    its mark positioning, metrics like caret slope, etc.

 pango/pangofc-font.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index 79bc166f..8643af7c 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -947,9 +947,11 @@ pango_fc_font_create_hb_font (PangoFont *font)
   double x_scale_inv, y_scale_inv;
   double x_scale, y_scale;
   double size;
+  double slant;
 
   x_scale_inv = y_scale_inv = 1.0;
   size = 1.0;
+  slant = 0.0;
 
   key = _pango_fc_font_get_font_key (fc_font);
   if (key)
@@ -974,6 +976,7 @@ pango_fc_font_create_hb_font (PangoFont *font)
       matrix2.xy = fc_matrix.xy;
       matrix2.yy = fc_matrix.yy;
       pango_matrix_get_font_scale_factors (&matrix2, &x, &y);
+      slant = pango_matrix_get_slant_ratio (&matrix2);
 
       x_scale_inv /= x;
       y_scale_inv /= y;
@@ -996,6 +999,7 @@ pango_fc_font_create_hb_font (PangoFont *font)
   hb_font_set_scale (hb_font,
                      size * PANGO_SCALE * x_scale,
                      size * PANGO_SCALE * y_scale);
+  //hb_set_synthetic_slant (hb_font, slant);
 
   if (key)
     {


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