changeset 43207:2dc57fcf62e9

(enum_font_cb2): Don't let charsets unknown to Windows match each other.
author Jason Rumney <jasonr@gnu.org>
date Sat, 09 Feb 2002 01:08:33 +0000
parents cc9c8c17538f
children a82b43a34436
files src/w32fns.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32fns.c	Sat Feb 09 00:01:10 2002 +0000
+++ b/src/w32fns.c	Sat Feb 09 01:08:33 2002 +0000
@@ -7038,11 +7038,13 @@
       {
         charset = xlfd_charset_of_font (XSTRING(*(lpef->pattern))->data);
 
-        /* Ensure that charset is valid for this font.
-	   Continue if invalid in case charset contains a wildcard.  */
-        if (charset
-            && (x_to_w32_charset (charset) != lplf->elfLogFont.lfCharSet))
-          charset = NULL;
+	/* We already checked charsets above, but DEFAULT_CHARSET
+           slipped through.  So only allow exact matches for DEFAULT_CHARSET.  */
+	if (charset
+	    && strncmp (charset, "*-*", 3) != 0
+	    && lpef->logfont.lfCharSet == DEFAULT_CHARSET
+	    && strcmp (charset, w32_to_x_charset (DEFAULT_CHARSET)) != 0)
+	  return 1;
       }
 
     if (charset)