summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Wu <pwu@redhat.com>2020-01-14 16:15:17 +0800
committerMarco Trevisan (TreviƱo) <mail@3v1n0.net>2021-05-05 17:31:44 +0200
commitcdfade7c9c864486f83220e2acff29b7f0553722 (patch)
tree7ec48c07ae62659e79074bf9761e830711a6d2e7
parent75950565d2a6e4d098849df60997ebfbf221e2a2 (diff)
downloadpango-cdfade7c9c864486f83220e2acff29b7f0553722.tar.gz
Translate origin point for vertical layout
The origin point for vertical layout needs to be translated for cairo rendering from the horizontal origin to the vertical origin. (cherry-picked from commit 4c6f0b3c)
-rw-r--r--pango/pangofc-shape.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c
index b6f74ca1..16d5d84d 100644
--- a/pango/pangofc-shape.c
+++ b/pango/pangofc-shape.c
@@ -409,9 +409,12 @@ pango_hb_shape (PangoFont *font,
for (i = 0; i < num_glyphs; i++)
{
/* 90 degrees rotation counter-clockwise. */
- infos[i].geometry.width = hb_position->y_advance;
- infos[i].geometry.x_offset = hb_position->y_offset;
- infos[i].geometry.y_offset = - hb_position->x_offset;
+ hb_position_t x_origin = 0, y_origin = 0;
+ hb_font_get_glyph_v_origin
+ (hb_font, infos[i].glyph, &x_origin, &y_origin);
+ infos[i].geometry.width = - hb_position->y_advance;
+ infos[i].geometry.x_offset = - hb_position->y_offset - y_origin;
+ infos[i].geometry.y_offset = - hb_position->x_offset - x_origin;
hb_position++;
}
else /* horizontal */