diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2020-06-26 10:14:07 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2020-06-26 10:14:07 +0200 |
commit | eece984b8c6fd6eeb663312d40db105a58ff9a84 (patch) | |
tree | 5e0f92bfb9ee55801c95f7db0afeb22bfbe80c5b /pango/pangocoretext.c | |
parent | 07c21d16be9cefbfbf82d357aab6896932d1f610 (diff) | |
download | pango-eece984b8c6fd6eeb663312d40db105a58ff9a84.tar.gz |
pangocoretext: Fix Cairo scaling
Take font scale into account when creating HarfBuzz fonts.
Fixes https://gitlab.gnome.org/GNOME/pango/-/issues/488
Diffstat (limited to 'pango/pangocoretext.c')
-rw-r--r-- | pango/pangocoretext.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pango/pangocoretext.c b/pango/pangocoretext.c index c261615e..44d2805a 100644 --- a/pango/pangocoretext.c +++ b/pango/pangocoretext.c @@ -176,12 +176,16 @@ pango_core_text_font_create_hb_font (PangoFont *font) if (ctfont->priv->font_ref) { + const PangoMatrix *matrix; hb_font_t *hb_font; + double x_scale, y_scale; int size; + matrix = pango_core_text_font_key_get_matrix (ctfont->priv->key); + pango_matrix_get_font_scale_factors (matrix, &x_scale, &y_scale); size = pango_core_text_font_key_get_size (ctfont->priv->key); hb_font = hb_coretext_font_create (ctfont->priv->font_ref); - hb_font_set_scale (hb_font, size, size); + hb_font_set_scale (hb_font, size / x_scale, size / y_scale); return hb_font; } |