diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32term.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/w32term.c b/src/w32term.c index af83ae53a2a..e25a270fc1d 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -388,8 +388,8 @@ static void x_clear_frame P_ ((void)); | |||
| 388 | static void x_clear_cursor P_ ((struct window *)); | 388 | static void x_clear_cursor P_ ((struct window *)); |
| 389 | static void frame_highlight P_ ((struct frame *)); | 389 | static void frame_highlight P_ ((struct frame *)); |
| 390 | static void frame_unhighlight P_ ((struct frame *)); | 390 | static void frame_unhighlight P_ ((struct frame *)); |
| 391 | static void w32_new_focus_frame P_ ((struct w32_display_info *, | 391 | static void x_new_focus_frame P_ ((struct w32_display_info *, |
| 392 | struct frame *)); | 392 | struct frame *)); |
| 393 | static void w32_frame_rehighlight P_ ((struct frame *)); | 393 | static void w32_frame_rehighlight P_ ((struct frame *)); |
| 394 | static void x_frame_rehighlight P_ ((struct w32_display_info *)); | 394 | static void x_frame_rehighlight P_ ((struct w32_display_info *)); |
| 395 | static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); | 395 | static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); |
| @@ -1210,9 +1210,20 @@ w32_native_per_char_metric (font, char2b, font_type, pcm) | |||
| 1210 | 1210 | ||
| 1211 | if (retval) | 1211 | if (retval) |
| 1212 | { | 1212 | { |
| 1213 | /* Don't trust the ABC widths. For synthesized fonts they are | ||
| 1214 | wrong, and so is the result of GetCharWidth()! */ | ||
| 1215 | int real_width; | ||
| 1216 | GetCharWidth (hdc, *char2b, *char2b, &real_width); | ||
| 1217 | |||
| 1213 | pcm->width = char_widths.abcA + char_widths.abcB + char_widths.abcC; | 1218 | pcm->width = char_widths.abcA + char_widths.abcB + char_widths.abcC; |
| 1219 | |||
| 1220 | /* As far as I can tell, this is the best way to determine what | ||
| 1221 | ExtTextOut will do with the broken font. */ | ||
| 1222 | if (pcm->width != real_width) | ||
| 1223 | pcm->width = (pcm->width + real_width) / 2; | ||
| 1224 | |||
| 1214 | pcm->lbearing = char_widths.abcA; | 1225 | pcm->lbearing = char_widths.abcA; |
| 1215 | pcm->rbearing = pcm->width - char_widths.abcC; | 1226 | pcm->rbearing = char_widths.abcA + char_widths.abcB; |
| 1216 | pcm->ascent = FONT_BASE (font); | 1227 | pcm->ascent = FONT_BASE (font); |
| 1217 | pcm->descent = FONT_DESCENT (font); | 1228 | pcm->descent = FONT_DESCENT (font); |
| 1218 | } | 1229 | } |