From: Jason Rumney Date: Sat, 2 Dec 2000 14:38:57 +0000 (+0000) Subject: (w32_bdf_per_char_metric): Dereference pointer correctly for single X-Git-Tag: emacs-pretest-21.0.93~295 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b99045f51005264a6cc3948124c56e7f3338323;p=emacs.git (w32_bdf_per_char_metric): Dereference pointer correctly for single byte character case. (w32_per_char_metric): Do not try to make any assumptions about the metrics of BDF fonts. --- diff --git a/src/w32term.c b/src/w32term.c index 3e9a731fdb2..4e80e88c10e 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1143,7 +1143,7 @@ w32_bdf_per_char_metric (font, char2b, dim, pcm) char buf[2]; if (dim == 1) - buf[0] = (char)char2b; + buf[0] = (char)(*char2b); else { buf[0] = BYTE1 (*char2b); @@ -1260,10 +1260,10 @@ w32_per_char_metric (font, char2b, font_type) xassert (font_type != UNKNOWN_FONT); /* Handle the common cases quickly. */ - if (font->per_char == NULL) + if (!font->bdf && font->per_char == NULL) /* TODO: determine whether char2b exists in font? */ return &font->max_bounds; - else if (*char2b < 128) + else if (!font->bdf && *char2b < 128) return &font->per_char[*char2b]; pcm = &font->scratch;