]> code.delx.au - gnu-emacs/blobdiff - src/w32bdf.c
* macterm.c: Remove consolidated defines and code.
[gnu-emacs] / src / w32bdf.c
index d2d33d72ca39f18a66220228079a9db368fd52ba..73f40a22df604ff597f5888841d2889d9f81c53e 100644 (file)
@@ -22,7 +22,11 @@ Boston, MA 02111-1307, USA.  */
    MULE for W32). */
 
 #include <windows.h>
-#include "config.h"
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "lisp.h"
 #include "charset.h"
 #include "keyboard.h"
@@ -50,7 +54,7 @@ cache_bitmap *pcached_bitmap_latest = cached_bitmap_slots;
 
 #define FONT_CACHE_SLOT_OVER_P(p) ((p) >= cached_bitmap_slots + BDF_FONT_CACHE_SIZE)
 
-static int 
+static int
 search_file_line(char *key, char *start, int len, char **val, char **next)
 {
   unsigned int linelen;
@@ -69,7 +73,7 @@ search_file_line(char *key, char *start, int len, char **val, char **next)
       *val = start + strlen(key);
       return 1;
     }
-  
+
   return 0;
 }
 
@@ -272,7 +276,7 @@ w32_init_bdf_font(char *filename)
     }
 
   bdffontp = (bdffont *) xmalloc(sizeof(bdffont));
-  
+
   for(i = 0;i < BDF_FIRST_OFFSET_TABLE;i++)
     bdffontp->chtbl[i] = NULL;
   bdffontp->size = fileinfo.nFileSizeLow;
@@ -281,7 +285,7 @@ w32_init_bdf_font(char *filename)
   bdffontp->hfilemap = hfilemap;
   bdffontp->filename = (char*) xmalloc(strlen(filename) + 1);
   strcpy(bdffontp->filename, filename);
-  
+
   if (!set_bdf_font_info(bdffontp))
     {
       w32_free_bdf_font(bdffontp);
@@ -360,7 +364,7 @@ cache_char_offset(bdffont *fontp, int index, unsigned char *offset)
     {
       pch = fontp->chtbl[BDF_FIRST_OFFSET(index)] =
        (font_char*) HeapAlloc(hbdf_cp_heap,
-                              HEAP_ZERO_MEMORY, 
+                              HEAP_ZERO_MEMORY,
                               sizeof(font_char) *
                                BDF_SECOND_OFFSET_TABLE);
       if (!pch) return NULL;
@@ -574,7 +578,7 @@ get_bitmap_with_cache(bdffont *fontp, int index)
   pcb->row_byte_size = glyph.row_byte_size;
 
   pch->pcbmp = pcb;
-  
+
   pcached_bitmap_latest++;
   if (FONT_CACHE_SLOT_OVER_P(pcached_bitmap_latest))
     pcached_bitmap_latest = cached_bitmap_slots;
@@ -645,7 +649,7 @@ w32_BDF_TextOut(bdffont *fontp, HDC hdc, int left,
     return 0;
 
   textalign = GetTextAlign(hdc);
-  
+
   hFgBrush = CreateSolidBrush(GetTextColor(hdc));
   hOrgBrush = SelectObject(hdc, hFgBrush);
 
@@ -675,7 +679,7 @@ w32_BDF_TextOut(bdffont *fontp, HDC hdc, int left,
        {
          width = pcb->metric.bbw;
          height = pcb->metric.bbh;
-         
+
          if (!(hBMP
                && (DIBsection_hdc == hdc)
                && (DIBsection_width == width)
@@ -786,6 +790,13 @@ struct font_info *w32_load_bdf_font (struct frame *f, char *fontname,
     fontp->relative_compose = bdf_font->relative_compose;
     fontp->default_ascent = bdf_font->default_ascent;
 
+    /* Set global flag fonts_changed_p to non-zero if the font loaded
+       has a character with a smaller width than any other character
+       before, or if the font loaded has a smaller height than any
+       other font loaded before.  If this happens, it will make a
+       glyph matrix reallocation necessary.  */
+    fonts_changed_p |= x_compute_min_glyph_bounds (f);
+
     UNBLOCK_INPUT;
     dpyinfo->n_fonts++;
     return fontp;