aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2005-01-03 22:53:30 +0000
committerJason Rumney2005-01-03 22:53:30 +0000
commitad5674f5a14ab073485f1301057ef5ec92e4b144 (patch)
tree4b4c87ee670ca2854f9df233e344e08e81a98b11 /src
parent3aefd49fb9aa586941aa971730049857e41843b5 (diff)
downloademacs-ad5674f5a14ab073485f1301057ef5ec92e4b144.tar.gz
emacs-ad5674f5a14ab073485f1301057ef5ec92e4b144.zip
(w32_load_system_font): Set FONT_WIDTH to maximum, not
average width. Set fontp->average_width and fontp->space_width to their appropriate values.
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 08780e05b1f..b7115601553 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -64,6 +64,7 @@ extern double atof ();
64extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object)); 64extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object));
65extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT)); 65extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT));
66extern void w32_free_menu_strings P_ ((HWND)); 66extern void w32_free_menu_strings P_ ((HWND));
67extern XCharStruct *w32_per_char_metric P_ ((XFontStruct *, wchar_t *, int));
67 68
68extern int quit_char; 69extern int quit_char;
69 70
@@ -4544,7 +4545,7 @@ w32_load_system_font (f,fontname,size)
4544 /* Fill out details in lf according to the font that was 4545 /* Fill out details in lf according to the font that was
4545 actually loaded. */ 4546 actually loaded. */
4546 lf.lfHeight = font->tm.tmInternalLeading - font->tm.tmHeight; 4547 lf.lfHeight = font->tm.tmInternalLeading - font->tm.tmHeight;
4547 lf.lfWidth = font->tm.tmAveCharWidth; 4548 lf.lfWidth = font->tm.tmMaxCharWidth;
4548 lf.lfWeight = font->tm.tmWeight; 4549 lf.lfWeight = font->tm.tmWeight;
4549 lf.lfItalic = font->tm.tmItalic; 4550 lf.lfItalic = font->tm.tmItalic;
4550 lf.lfCharSet = font->tm.tmCharSet; 4551 lf.lfCharSet = font->tm.tmCharSet;
@@ -4592,6 +4593,24 @@ w32_load_system_font (f,fontname,size)
4592 fontp->name = (char *) xmalloc (strlen (fontname) + 1); 4593 fontp->name = (char *) xmalloc (strlen (fontname) + 1);
4593 bcopy (fontname, fontp->name, strlen (fontname) + 1); 4594 bcopy (fontname, fontp->name, strlen (fontname) + 1);
4594 4595
4596 if (lf.lfPitchAndFamily == FIXED_PITCH)
4597 {
4598 /* Fixed width font. */
4599 fontp->average_width = fontp->space_width = FONT_WIDTH (font);
4600 }
4601 else
4602 {
4603 wchar_t space = 32;
4604 XCharStruct* pcm;
4605 pcm = w32_per_char_metric (font, &space, ANSI_FONT);
4606 if (pcm)
4607 fontp->space_width = pcm->width;
4608 else
4609 fontp->space_width = FONT_WIDTH (font);
4610
4611 fontp->average_width = font->tm.tmAveCharWidth;
4612 }
4613
4595 charset = xlfd_charset_of_font (fontname); 4614 charset = xlfd_charset_of_font (fontname);
4596 4615
4597 /* Cache the W32 codepage for a font. This makes w32_encode_char 4616 /* Cache the W32 codepage for a font. This makes w32_encode_char