From: handa Date: Fri, 9 Nov 2007 07:43:04 +0000 (+0000) Subject: (xfont_find_metric): Delete invalid "continue" line. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1b2585a77fc7cb194e2085f216a73409d7d1c68c;p=m17n%2Fm17n-lib.git (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. --- 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) {