[pango/issue488] pangocoretext: Fix Cairo scaling
- From: Khaled Hosny <khaledh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/issue488] pangocoretext: Fix Cairo scaling
- Date: Fri, 26 Jun 2020 08:15:41 +0000 (UTC)
commit eece984b8c6fd6eeb663312d40db105a58ff9a84
Author: Khaled Hosny <khaledhosny eglug org>
Date: Fri Jun 26 10:14:07 2020 +0200
pangocoretext: Fix Cairo scaling
Take font scale into account when creating HarfBuzz fonts.
Fixes https://gitlab.gnome.org/GNOME/pango/-/issues/488
pango/pangocoretext.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]