From e874518153e509b74aa8e3e52b02642718eb5575 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 9 Mar 2013 12:26:48 +0100 Subject: font: pango: fix vertical alignment of non-ASCII glyphs pango_ft2_render_layout_line() requires the baseline offset as argument, not the vertical extent of the glyphs. This is important as we currently align glyphs to the bottom edge instead of the baseline. Fix this by passing the cached baseline offset so all glyphs are correctly aligned to the baseline. We then clip according to the cell-extents as usual. Signed-off-by: David Herrmann --- src/font_pango.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/font_pango.c b/src/font_pango.c index c2954c6..0964123 100644 --- a/src/font_pango.c +++ b/src/font_pango.c @@ -199,7 +199,7 @@ static int get_glyph(struct face *face, struct kmscon_glyph **out, bitmap.pixel_mode = FT_PIXEL_MODE_GRAY; bitmap.buffer = glyph->buf.data; - pango_ft2_render_layout_line(&bitmap, line, -rec.x, -rec.y); + pango_ft2_render_layout_line(&bitmap, line, -rec.x, face->baseline); pthread_mutex_lock(&face->glyph_lock); ret = shl_hashtable_insert(face->glyphs, (void*)(long)id, glyph); -- cgit v1.2.3