summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChang Liu <cl91tp@gmail.com>2013-03-09 12:26:48 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-03-09 12:26:48 +0100
commite874518153e509b74aa8e3e52b02642718eb5575 (patch)
tree111c82631c68b95fe19b739947ce7990493a5c5e /src
parent1658bd82164c50cc048bae5a28cd223a7d45ff1e (diff)
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 <dh.herrmann@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/font_pango.c2
1 files changed, 1 insertions, 1 deletions
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);