aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/macterm.c')
-rw-r--r--src/macterm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 4d80fbac5fa..566f0c5b04b 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -6715,14 +6715,19 @@ XLoadQueryFont (Display *dpy, char *fontname)
6715 char_width = CharWidth (c); 6715 char_width = CharWidth (c);
6716 font->per_char[c - 0x20].width = char_width; 6716 font->per_char[c - 0x20].width = char_width;
6717 font->per_char[c - 0x20].rbearing = char_width; 6717 font->per_char[c - 0x20].rbearing = char_width;
6718 min_width = min (min_width, char_width); 6718 /* Some Japanese fonts (in SJIS encoding) return 0 as the
6719 max_width = max (max_width, char_width); 6719 character width of 0x7f. */
6720 } 6720 if (char_width > 0)
6721 {
6722 min_width = min (min_width, char_width);
6723 max_width = max (max_width, char_width);
6724 }
6725 }
6721 font->min_bounds.width = min_width; 6726 font->min_bounds.width = min_width;
6722 font->max_bounds.width = max_width; 6727 font->max_bounds.width = max_width;
6723 } 6728 }
6724 } 6729 }
6725 6730
6726 TextFont (old_fontnum); /* restore previous font number, size and face */ 6731 TextFont (old_fontnum); /* restore previous font number, size and face */
6727 TextSize (old_fontsize); 6732 TextSize (old_fontsize);
6728 TextFace (old_fontface); 6733 TextFace (old_fontface);