+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.
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);