changeset 91070:2060802cc53f

(add_font_name_to_list): Avoid vertical fonts. (font_matches_spec): Remove debug output. (add_font_entity_to_list): Avoid using substituted fonts.
author Jason Rumney <jasonr@gnu.org>
date Fri, 26 Oct 2007 23:50:29 +0000
parents 6277bc0e513a
children ef6966714dd4
files src/w32font.c
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32font.c	Tue Oct 23 04:40:55 2007 +0000
+++ b/src/w32font.c	Fri Oct 26 23:50:29 2007 +0000
@@ -639,8 +639,14 @@
      LPARAM list_object;
 {
   Lisp_Object* list = (Lisp_Object *) list_object;
-  Lisp_Object family = intern_downcase (logical_font->elfLogFont.lfFaceName,
-                                        strlen (logical_font->elfLogFont.lfFaceName));
+  Lisp_Object family;
+
+  /* Skip vertical fonts (intended only for printing)  */
+  if (logical_font->elfLogFont.lfFaceName[0] == '@')
+    return 1;
+
+  family = intern_downcase (logical_font->elfLogFont.lfFaceName,
+                            strlen (logical_font->elfLogFont.lfFaceName));
   if (! memq_no_quit (family, *list))
     *list = Fcons (family, *list);
 
@@ -785,10 +791,7 @@
       int slant = XINT (val);
       if ((slant > 150 && !font->ntmTm.tmItalic)
           || (slant <= 150 && font->ntmTm.tmItalic))
-        {
-          OutputDebugString ("italic mismatch");
         return 0;
-        }
     }
 
   /* Check extra parameters.  */
@@ -944,7 +947,11 @@
 
   if (logfonts_match (&logical_font->elfLogFont, &match_data->pattern)
       && font_matches_spec (font_type, physical_font,
-                            match_data->orig_font_spec))
+                            match_data->orig_font_spec)
+      /* Avoid Windows substitution so we can control substitution with
+         alternate-fontname-alist.  */
+      && !strnicmp (&logical_font->elfFullName,
+                    &match_data->pattern.lfFaceName, LF_FACESIZE))
     {
       Lisp_Object entity
         = w32_enumfont_pattern_entity (match_data->frame, logical_font,