changeset 4579:68f74b080e94

Accept msprinter and mswindows, mswindows_font_spec_matches_charset_stage_2 src/ChangeLog addition: 2009-01-10 Aidan Kehoe <kehoea@parhasard.net> * objects-msw.c (mswindows_font_spec_matches_charset_stage_2): Accept msprinter as well as mswindows devices here.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 18 Jan 2009 12:41:58 +0000
parents 49e17f7182f5
children c02fdef8db8b
files src/ChangeLog src/objects-msw.c
diffstat 2 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Jan 18 12:14:19 2009 +0200
+++ b/src/ChangeLog	Sun Jan 18 12:41:58 2009 +0000
@@ -1,3 +1,8 @@
+2009-01-10  Aidan Kehoe <kehoea@parhasard.net>
+
+	* objects-msw.c (mswindows_font_spec_matches_charset_stage_2): 
+	Accept msprinter as well as mswindows devices here. 
+
 2008-12-30  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* device-x.c (Fx_get_font_path): 
--- a/src/objects-msw.c	Sun Jan 18 12:14:19 2009 +0200
+++ b/src/objects-msw.c	Sun Jan 18 12:41:58 2009 +0000
@@ -2064,8 +2064,21 @@
   else
     {
       HDC hdc = CreateCompatibleDC (NULL);
-      Lisp_Object font_list = DEVICE_MSWINDOWS_FONTLIST (d);
-      Lisp_Object truename;
+      Lisp_Object font_list = Qnil, truename; 
+
+      if (DEVICE_TYPE_P (d, mswindows))
+	{
+	  font_list = DEVICE_MSWINDOWS_FONTLIST (d);
+	}
+      else if (DEVICE_TYPE_P (d, msprinter))
+	{
+	  font_list = DEVICE_MSPRINTER_FONTLIST (d);
+	}
+      else
+	{
+	  assert(0);
+	}
+
       HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
 						 font_list,
 						 ERROR_ME_DEBUG_WARN,