1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-30 00:51:50 -08:00

* macterm.c (XLoadQueryFont): Correctly handle 0 size

font widths that are returned from some Japanese fonts.
This commit is contained in:
Steven Tamm 2005-01-07 07:11:24 +00:00
parent 112d84efad
commit a6fffcdcb7
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2005-01-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* macterm.c (XLoadQueryFont): Correctly handle 0 size
font widths that are returned from some Japanese fonts.
2005-01-06 Kim F. Storm <storm@cua.dk>
* fringe.c (fringe_faces): Change to Lisp_Object pointer.

View file

@ -6715,14 +6715,19 @@ XLoadQueryFont (Display *dpy, char *fontname)
char_width = CharWidth (c);
font->per_char[c - 0x20].width = char_width;
font->per_char[c - 0x20].rbearing = char_width;
min_width = min (min_width, char_width);
max_width = max (max_width, char_width);
}
/* Some Japanese fonts (in SJIS encoding) return 0 as the
character width of 0x7f. */
if (char_width > 0)
{
min_width = min (min_width, char_width);
max_width = max (max_width, char_width);
}
}
font->min_bounds.width = min_width;
font->max_bounds.width = max_width;
}
}
TextFont (old_fontnum); /* restore previous font number, size and face */
TextSize (old_fontsize);
TextFace (old_fontface);