From 1b2585a77fc7cb194e2085f216a73409d7d1c68c Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 9 Nov 2007 07:43:04 +0000 Subject: [PATCH] (xfont_find_metric): Delete invalid "continue" line. (xfont_find_metric): Set metrics in 26.6 fixed pixel. (xfont_render): Set baseline_offset in pixel. (xft_render): Fix handling of baseline_offset. --- src/m17n-X.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/m17n-X.c b/src/m17n-X.c index 0115278..0af354d 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -704,7 +704,6 @@ xfont_find_metric (MRealizedFont *rfont, MGlyphString *gstring, for (; g != gend; g++) if (! g->g.measured) { - continue; if (g->g.code == MCHAR_INVALID_CODE) { g->g.lbearing = xfont->max_bounds.lbearing << 6; @@ -765,8 +764,8 @@ xfont_find_metric (MRealizedFont *rfont, MGlyphString *gstring, } } g->g.yadv = 0; - g->g.ascent += rfont->baseline_offset << 6; - g->g.descent -= rfont->baseline_offset << 6; + g->g.ascent += rfont->baseline_offset; + g->g.descent -= rfont->baseline_offset; g->g.measured = 1; } } @@ -859,7 +858,7 @@ xfont_render (MDrawWindow win, int x, int y, MGlyphString *gstring, if (from == to) return; - baseline_offset = rface->rfont->baseline_offset; + baseline_offset = rface->rfont->baseline_offset >> 6; if (region) gc = set_region (rface->frame, gc, region); XSetFont (display, gc, ((XFontStruct *) rface->rfont->fontp)->fid); @@ -1308,7 +1307,7 @@ xft_render (MDrawWindow win, int x, int y, XftDrawChange (xft_draw, (Drawable) win); XftDrawSetClip (xft_draw, (Region) region); - y -= rfont->baseline_offset; + y -= rfont->baseline_offset >> 6; glyphs = alloca (sizeof (FT_UInt) * (to - from)); for (last_x = x, nglyphs = 0, g = from; g < to; x += g++->g.xadv) { -- 1.7.10.4