]> git.eshelyaron.com Git - emacs.git/commitdiff
(w32font_open_internal): Change last argument from
authorJason Rumney <jasonr@gnu.org>
Fri, 2 May 2008 10:46:21 +0000 (10:46 +0000)
committerJason Rumney <jasonr@gnu.org>
Fri, 2 May 2008 10:46:21 +0000 (10:46 +0000)
w32font_info struct to font object. Fill in font object from
font_entity.
(w32font_open): Pass font_object to w32font_open_internal.

src/w32font.c

index 2ba254fb0967d0a9666409c5bda4cf81085b62a3..7a183a6bd081446c191d2cdde461da2b092e229c 100644 (file)
@@ -211,12 +211,10 @@ w32font_open (f, font_entity, pixel_size)
      int pixel_size;
 {
   Lisp_Object font_object;
-  struct w32font_info *w32_font;
 
   font_object = font_make_object (VECSIZE (struct w32font_info));
-  w32_font = (struct w32font_info *) XFONT_OBJECT (font_object);
 
-  if (!w32font_open_internal (f, font_entity, pixel_size, w32_font))
+  if (!w32font_open_internal (f, font_entity, pixel_size, font_object))
     {
       return Qnil;
     }
@@ -746,24 +744,33 @@ w32font_match_internal (frame, font_spec, opentype_only)
 }
 
 int
-w32font_open_internal (f, font_entity, pixel_size, w32_font)
+w32font_open_internal (f, font_entity, pixel_size, font_object)
      FRAME_PTR f;
      Lisp_Object font_entity;
      int pixel_size;
-     struct w32font_info *w32_font;
+     Lisp_Object font_object;
 {
-  int len, size;
+  int len, size, i;
   LOGFONT logfont;
   HDC dc;
   HFONT hfont, old_font;
   Lisp_Object val, extra;
   /* For backwards compatibility.  */
   W32FontStruct *compat_w32_font;
+  struct w32font_info *w32_font;
+  struct font * font;
+
+  w32_font = (struct w32font_info *) XFONT_OBJECT (font_object);
+  font = (struct font *) w32_font;
 
-  struct font * font = (struct font *) w32_font;
   if (!font)
     return 0;
 
+  /* Copy from font entity.  */
+  for (i = 0; i < FONT_ENTITY_MAX; i++)
+    ASET (font_object, i, AREF (font_entity, i));
+  ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size));
+
   bzero (&logfont, sizeof (logfont));
   fill_in_logfont (f, &logfont, font_entity);