(-windowDidResize:): Avoid inf-loop under GNUStep.
[bpt/emacs.git] / src / w32font.c
index d28483a..7d9db3a 100644 (file)
@@ -68,7 +68,7 @@ extern Lisp_Object Qnone; /* reuse from w32fns.c  */
 static Lisp_Object Qstandard, Qsubpixel, Qnatural;
 
 /* languages */
-static Lisp_Object Qja, Qko, Qzh;
+static Lisp_Object Qzh;
 
 /* scripts */
 static Lisp_Object Qlatin, Qgreek, Qcoptic, Qcyrillic, Qarmenian, Qhebrew;
@@ -114,7 +114,6 @@ static Lisp_Object font_supported_scripts P_ ((FONTSIGNATURE *));
 static int w32font_full_name P_ ((LOGFONT *, Lisp_Object, int, char *, int));
 static void compute_metrics P_ ((HDC, struct w32font_info *, unsigned int,
                                 struct w32_metric_cache *));
-static void clear_cached_metrics P_ ((struct w32font_info *));
 
 static Lisp_Object w32_registry P_ ((LONG, DWORD));
 
@@ -1374,6 +1373,14 @@ check_face_name (font, full_name)
       _strlwr (full_iname);
       return strstr ("helvetica", full_iname) != NULL;
     }
+  /* Same for Helv.  */
+  if (!xstrcasecmp (font->lfFaceName, "helv"))
+    {
+      strncpy (full_iname, full_name, LF_FULLFACESIZE);
+      full_iname[LF_FULLFACESIZE] = 0;
+      _strlwr (full_iname);
+      return strstr ("helv", full_iname) != NULL;
+    }
 
   /* Since Times is mapped to Times New Roman, a substring
      match is not sufficient to filter out the bogus match.  */
@@ -1437,9 +1444,8 @@ add_font_entity_to_list (logical_font, physical_font, font_type, lParam)
                   logical_font->elfLogFont.lfFaceName))
       /* Check for well known substitutions that mess things up in the
         presence of Type-1 fonts of the same name.  */
-      || (match_data->pattern.lfFaceName[0]
-         && !check_face_name (&logical_font->elfLogFont,
-                              logical_font->elfFullName)))
+      || (!check_face_name (&logical_font->elfLogFont,
+                           logical_font->elfFullName)))
     return 1;
 
   /* Make a font entity for the font.  */
@@ -2383,19 +2389,6 @@ compute_metrics (dc, w32_font, code, metrics)
     metrics->status = W32METRIC_FAIL;
 }
 
-static void
-clear_cached_metrics (w32_font)
-     struct w32font_info *w32_font;
-{
-  int i;
-  for (i = 0; i < w32_font->n_cache_blocks; i++)
-    {
-      if (w32_font->cached_metrics[i])
-        bzero (w32_font->cached_metrics[i],
-               CACHE_BLOCKSIZE * sizeof (struct font_metrics));
-    }
-}
-
 DEFUN ("x-select-font", Fx_select_font, Sx_select_font, 0, 2, 0,
        doc: /* Read a font name using a W32 font selection dialog.
 Return fontconfig style font string corresponding to the selection.
@@ -2514,8 +2507,6 @@ syms_of_w32font ()
   DEFSYM (Qnatural, "natural");
 
   /* Languages  */
-  DEFSYM (Qja, "ja");
-  DEFSYM (Qko, "ko");
   DEFSYM (Qzh, "zh");
 
   /* Scripts  */