emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32fns.c


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/src/w32fns.c
Date: Mon, 03 Jan 2005 18:06:06 -0500

Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.245 emacs/src/w32fns.c:1.246
*** emacs/src/w32fns.c:1.245    Tue Nov  2 08:55:10 2004
--- emacs/src/w32fns.c  Mon Jan  3 22:53:30 2005
***************
*** 64,69 ****
--- 64,70 ----
  extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object));
  extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT));
  extern void w32_free_menu_strings P_ ((HWND));
+ extern XCharStruct *w32_per_char_metric P_ ((XFontStruct *, wchar_t *, int));
  
  extern int quit_char;
  
***************
*** 4544,4550 ****
          /* Fill out details in lf according to the font that was
             actually loaded.  */
          lf.lfHeight = font->tm.tmInternalLeading - font->tm.tmHeight;
!         lf.lfWidth = font->tm.tmAveCharWidth;
          lf.lfWeight = font->tm.tmWeight;
          lf.lfItalic = font->tm.tmItalic;
          lf.lfCharSet = font->tm.tmCharSet;
--- 4545,4551 ----
          /* Fill out details in lf according to the font that was
             actually loaded.  */
          lf.lfHeight = font->tm.tmInternalLeading - font->tm.tmHeight;
!         lf.lfWidth = font->tm.tmMaxCharWidth;
          lf.lfWeight = font->tm.tmWeight;
          lf.lfItalic = font->tm.tmItalic;
          lf.lfCharSet = font->tm.tmCharSet;
***************
*** 4592,4597 ****
--- 4593,4616 ----
      fontp->name = (char *) xmalloc (strlen (fontname) + 1);
      bcopy (fontname, fontp->name, strlen (fontname) + 1);
  
+     if (lf.lfPitchAndFamily == FIXED_PITCH)
+       {
+       /* Fixed width font.  */
+       fontp->average_width = fontp->space_width = FONT_WIDTH (font);
+       }
+     else
+       {
+       wchar_t space = 32;
+       XCharStruct* pcm;
+       pcm = w32_per_char_metric (font, &space, ANSI_FONT);
+       if (pcm)
+         fontp->space_width = pcm->width;
+       else
+         fontp->space_width = FONT_WIDTH (font);
+ 
+       fontp->average_width = font->tm.tmAveCharWidth;
+       }
+ 
      charset = xlfd_charset_of_font (fontname);
  
    /* Cache the W32 codepage for a font.  This makes w32_encode_char




reply via email to

[Prev in Thread] Current Thread [Next in Thread]