Commit 4f64a164 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(xfont_open): Fix calculation of font->average_width.

parent 35611703
2008-05-27 Kenichi Handa <handa@m17n.org>
* xfont.c (xfont_open): Fix calculation of font->average_width.
2008-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
* casefiddle.c (casify_object): Try to guess better whether the
......
......@@ -613,8 +613,14 @@ xfont_open (f, entity, pixel_size)
for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++)
if ((pcm = xfont_get_pcm (xfont, &char2b)) != NULL)
width += pcm->width, n++;
if (n > 0)
font->average_width = width / n;
}
if (font->average_width == 0)
/* No easy way other than this to get a reasonable
average_width. */
font->average_width
= (xfont->min_bounds.width + xfont->max_bounds.width) / 2;
}
BLOCK_INPUT;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment