]> code.delx.au - gnu-emacs/blobdiff - src/w32uniscribe.c
In display-buffer-record-window record selected window if necessary.
[gnu-emacs] / src / w32uniscribe.c
index d06586f973ab5a9b653fa7a3b0b3c4804b5cf86b..73c0410c7b7fdfe3e8827c70f179631d9c43297d 100644 (file)
@@ -1,5 +1,5 @@
 /* Font backend for the Microsoft W32 Uniscribe API.
-   Copyright (C) 2008-2014 Free Software Foundation, Inc.
+   Copyright (C) 2008-2015 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -47,14 +47,10 @@ struct uniscribe_font_info
 
 int uniscribe_available = 0;
 
-/* Defined in w32font.c, since it is required there as well.  */
-extern Lisp_Object Quniscribe;
-extern Lisp_Object Qopentype;
-
 /* EnumFontFamiliesEx callback.  */
-static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *,
-                                                    NEWTEXTMETRICEX *,
-                                                    DWORD, LPARAM);
+static int CALLBACK ALIGN_STACK add_opentype_font_name_to_list (ENUMLOGFONTEX *,
+                                                               NEWTEXTMETRICEX *,
+                                                               DWORD, LPARAM);
 /* Used by uniscribe_otf_capability.  */
 static Lisp_Object otf_features (HDC context, char *table);
 
@@ -71,7 +67,7 @@ memq_no_quit (Lisp_Object elt, Lisp_Object list)
 static Lisp_Object
 uniscribe_list (struct frame *f, Lisp_Object font_spec)
 {
-  Lisp_Object fonts = w32font_list_internal (f, font_spec, 1);
+  Lisp_Object fonts = w32font_list_internal (f, font_spec, true);
   FONT_ADD_LOG ("uniscribe-list", font_spec, fonts);
   return fonts;
 }
@@ -79,7 +75,7 @@ uniscribe_list (struct frame *f, Lisp_Object font_spec)
 static Lisp_Object
 uniscribe_match (struct frame *f, Lisp_Object font_spec)
 {
-  Lisp_Object entity = w32font_match_internal (f, font_spec, 1);
+  Lisp_Object entity = w32font_match_internal (f, font_spec, true);
   FONT_ADD_LOG ("uniscribe-match", font_spec, entity);
   return entity;
 }
@@ -187,8 +183,9 @@ uniscribe_otf_capability (struct font *font)
 static Lisp_Object
 uniscribe_shape (Lisp_Object lgstring)
 {
-  struct font * font;
-  struct uniscribe_font_info * uniscribe_font;
+  struct font *font = CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring));
+  struct uniscribe_font_info *uniscribe_font
+    = (struct uniscribe_font_info *) font;
   EMACS_UINT nchars;
   int nitems, max_items, i, max_glyphs, done_glyphs;
   wchar_t *chars;
@@ -203,9 +200,6 @@ uniscribe_shape (Lisp_Object lgstring)
   HDC context = NULL;
   HFONT old_font = NULL;
 
-  CHECK_FONT_GET_OBJECT (LGSTRING_FONT (lgstring), font);
-  uniscribe_font = (struct uniscribe_font_info *) font;
-
   /* Get the chars from lgstring in a form we can use with uniscribe.  */
   max_glyphs = nchars = LGSTRING_GLYPH_LEN (lgstring);
   done_glyphs = 0;
@@ -591,8 +585,8 @@ uniscribe_encode_char (struct font *font, int c)
    Lisp_Object uniscribe_get_cache (Lisp_Object frame);
    void uniscribe_free_entity (Lisp_Object font_entity);
    int uniscribe_has_char (Lisp_Object entity, int c);
-   int uniscribe_text_extents (struct font *font, unsigned *code,
-                               int nglyphs, struct font_metrics *metrics);
+   void uniscribe_text_extents (struct font *font, unsigned *code,
+                                int nglyphs, struct font_metrics *metrics);
    int uniscribe_draw (struct glyph_string *s, int from, int to,
                        int x, int y, int with_background);
 
@@ -613,7 +607,7 @@ uniscribe_encode_char (struct font *font, int c)
 /* Callback function for EnumFontFamiliesEx.
    Adds the name of opentype fonts to a Lisp list (passed in as the
    lParam arg). */
-static int CALLBACK
+static int CALLBACK ALIGN_STACK
 add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font,
                                NEWTEXTMETRICEX *physical_font,
                                DWORD font_type, LPARAM list_object)