aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 04fada87196..8eb3c3ee218 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -144,6 +144,8 @@ Lisp_Object Vw32_bdf_filename_alist;
144/* A flag to control how to display unibyte 8-bit character. */ 144/* A flag to control how to display unibyte 8-bit character. */
145int unibyte_display_via_language_environment; 145int unibyte_display_via_language_environment;
146 146
147int w32_strict_fontnames;
148
147/* Evaluate this expression to rebuild the section of syms_of_w32fns 149/* Evaluate this expression to rebuild the section of syms_of_w32fns
148 that initializes and staticpros the symbols declared below. Note 150 that initializes and staticpros the symbols declared below. Note
149 that Emacs 18 has a bug that keeps C-x C-e from being able to 151 that Emacs 18 has a bug that keeps C-x C-e from being able to
@@ -4774,7 +4776,7 @@ This function is an internal primitive--use `make-frame' instead.")
4774 if (STRINGP (tem)) 4776 if (STRINGP (tem))
4775 font = x_new_fontset (f, XSTRING (tem)->data); 4777 font = x_new_fontset (f, XSTRING (tem)->data);
4776 else 4778 else
4777 font = x_new_font (f, XSTRING (font)->data); 4779 font = x_new_font (f, XSTRING (font)->data);
4778 } 4780 }
4779 /* Try out a font which we hope has bold and italic variations. */ 4781 /* Try out a font which we hope has bold and italic variations. */
4780 if (!STRINGP (font)) 4782 if (!STRINGP (font))
@@ -4985,7 +4987,7 @@ int size;
4985#endif 4987#endif
4986 fontname = (char *) XSTRING (XCONS (font_names)->car)->data; 4988 fontname = (char *) XSTRING (XCONS (font_names)->car)->data;
4987 } 4989 }
4988 else 4990 else if (w32_strict_fontnames)
4989 { 4991 {
4990 /* If EnumFontFamiliesEx was available, we got a full list of 4992 /* If EnumFontFamiliesEx was available, we got a full list of
4991 fonts back so stop now to avoid the possibility of loading a 4993 fonts back so stop now to avoid the possibility of loading a
@@ -4994,7 +4996,7 @@ int size;
4994 listed or not. */ 4996 listed or not. */
4995 HMODULE gdi32 = GetModuleHandle ("gdi32.dll"); 4997 HMODULE gdi32 = GetModuleHandle ("gdi32.dll");
4996 FARPROC enum_font_families_ex 4998 FARPROC enum_font_families_ex
4997 = GetProcAddress ( gdi32, "EnumFontFamiliesExA"); 4999 = GetProcAddress (gdi32, "EnumFontFamiliesExA");
4998 if (enum_font_families_ex) 5000 if (enum_font_families_ex)
4999 return NULL; 5001 return NULL;
5000 } 5002 }
@@ -7398,6 +7400,16 @@ displayed according to the current fontset.");
7398 "List of bdf fonts and their corresponding filenames."); 7400 "List of bdf fonts and their corresponding filenames.");
7399 Vw32_bdf_filename_alist = Qnil; 7401 Vw32_bdf_filename_alist = Qnil;
7400 7402
7403 DEFVAR_BOOL ("w32-strict-fontnames",
7404 &w32_strict_fontnames,
7405 "Non-nil means only use fonts that are exact matches for those requested.\n\
7406Default is nil, which allows old fontnames that are not XLFD compliant,\n\
7407and allows third-party CJK display to work by specifying false charset\n\
7408fields to trick Emacs into translating to Big5, SJIS etc.\n\
7409Setting this to t will prevent wrong fonts being selected when\n\
7410fontsets are automatically created.");
7411 w32_strict_fontnames = 0;
7412
7401 defsubr (&Sx_get_resource); 7413 defsubr (&Sx_get_resource);
7402 defsubr (&Sx_list_fonts); 7414 defsubr (&Sx_list_fonts);
7403 defsubr (&Sx_display_color_p); 7415 defsubr (&Sx_display_color_p);