From: handa Date: Tue, 6 Nov 2007 04:45:16 +0000 (+0000) Subject: (xfont_open): Keep rfont's metrics in 26.6 fixed pixels. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3dc03ab12386138074d42c41b66e14e292e0b34;p=m17n%2Fm17n-lib.git (xfont_open): Keep rfont's metrics in 26.6 fixed pixels. (xfont_find_metric): Set glyph's yadv to 0. (xft_find_metric): Likewise. --- diff --git a/src/m17n-X.c b/src/m17n-X.c index 4a1d677..0115278 100644 --- a/src/m17n-X.c +++ b/src/m17n-X.c @@ -676,14 +676,14 @@ xfont_open (MFrame *frame, MFont *font, MFont *spec, MRealizedFont *rfont) rfont->baseline_offset = (XGetFontProperty (xfont, disp_info->MULE_BASELINE_OFFSET, &value) - ? (int) value : 0); + ? (int) (value << 6) : 0); rfont->average_width = (XGetFontProperty (xfont, disp_info->AVERAGE_WIDTH, &value) - ? (int) value / 10 : 0); + ? (int) (value << 6) / 10 : 0); } - rfont->ascent = xfont->ascent + rfont->baseline_offset; - rfont->descent = xfont->descent - rfont->baseline_offset; - rfont->max_advance = xfont->max_bounds.width; + rfont->ascent = (xfont->ascent << 6) + rfont->baseline_offset; + rfont->descent = (xfont->descent << 6) - rfont->baseline_offset; + rfont->max_advance = xfont->max_bounds.width << 6; rfont->x_ppem = rfont->y_ppem = size / 10; rfont->fontp = xfont; rfont->next = MPLIST_VAL (frame->realized_font_list); @@ -764,6 +764,7 @@ xfont_find_metric (MRealizedFont *rfont, MGlyphString *gstring, g->g.descent = xfont->descent << 6; } } + g->g.yadv = 0; g->g.ascent += rfont->baseline_offset << 6; g->g.descent -= rfont->baseline_offset << 6; g->g.measured = 1; @@ -1205,6 +1206,8 @@ xft_find_metric (MRealizedFont *rfont, MGlyphString *gstring, g->g.ascent = extents.y << 6; g->g.descent = (extents.height - extents.y) << 6; } + g->g.yadv = 0; + g->g.measured = 0; } }