Move DONT_REOPEN_PTY from src/s to configure
[bpt/emacs.git] / src / w32uniscribe.c
index 05cc834..06f7b1b 100644 (file)
@@ -1,5 +1,5 @@
 /* Font backend for the Microsoft W32 Uniscribe API.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -52,10 +52,6 @@ int uniscribe_available = 0;
 extern Lisp_Object Quniscribe;
 extern Lisp_Object Qopentype;
 
-extern int initialized;
-
-extern struct font_driver uniscribe_font_driver;
-
 /* EnumFontFamiliesEx callback.  */
 static int CALLBACK add_opentype_font_name_to_list (ENUMLOGFONTEX *,
                                                     NEWTEXTMETRICEX *,
@@ -235,7 +231,7 @@ uniscribe_shape (Lisp_Object lgstring)
   /* First we need to break up the glyph string into runs of glyphs that
      can be treated together.  First try a single run.  */
   max_items = 2;
-  items = (SCRIPT_ITEM *) xmalloc (sizeof (SCRIPT_ITEM) * max_items + 1);
+  items = xmalloc (sizeof (SCRIPT_ITEM) * max_items + 1);
 
   while ((result = ScriptItemize (chars, nchars, max_items, NULL, NULL,
                                  items, &nitems)) == E_OUTOFMEMORY)
@@ -324,7 +320,7 @@ uniscribe_shape (Lisp_Object lgstring)
            }
           if (SUCCEEDED (result))
            {
-             int j, nclusters, from, to;
+             int j, from, to;
 
              from = 0;
              to = from;
@@ -439,7 +435,7 @@ uniscribe_shape (Lisp_Object lgstring)
 }
 
 /* Uniscribe implementation of encode_char for font backend.
-   Return a glyph code of FONT for characer C (Unicode code point).
+   Return a glyph code of FONT for character C (Unicode code point).
    If FONT doesn't have such a glyph, return FONT_INVALID_CODE.  */
 static unsigned
 uniscribe_encode_char (struct font *font, int c)
@@ -473,7 +469,7 @@ uniscribe_encode_char (struct font *font, int c)
 
   /* Non BMP characters must be handled by the uniscribe shaping
      engine as GDI functions (except blindly displaying lines of
-     unicode text) and the promising looking ScriptGetCMap do not
+     Unicode text) and the promising looking ScriptGetCMap do not
      convert surrogate pairs to glyph indexes correctly.  */
     {
       items = (SCRIPT_ITEM *) alloca (sizeof (SCRIPT_ITEM) * 2 + 1);
@@ -511,7 +507,7 @@ uniscribe_encode_char (struct font *font, int c)
           if (SUCCEEDED (result) && nglyphs == 1)
             {
              /* Some fonts return .notdef glyphs instead of failing.
-                (Truetype spec reserves glyph code 0 for .notdef)  */
+                (TrueType spec reserves glyph code 0 for .notdef)  */
              if (glyphs[0])
                code = glyphs[0];
             }
@@ -585,7 +581,7 @@ add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font,
       && font_type != TRUETYPE_FONTTYPE)
     return 1;
 
-  /* Skip fonts that have no unicode coverage.  */
+  /* Skip fonts that have no Unicode coverage.  */
   if (!physical_font->ntmFontSig.fsUsb[3]
       && !physical_font->ntmFontSig.fsUsb[2]
       && !physical_font->ntmFontSig.fsUsb[1]
@@ -633,8 +629,6 @@ add_opentype_font_name_to_list (ENUMLOGFONTEX *logical_font,
     STR[4] = '\0';                                           \
   } while (0)
 
-static char* NOTHING = "    ";
-
 #define SNAME(VAL) SDATA (SYMBOL_NAME (VAL))
 
 /* Check if font supports the otf script/language/features specified.
@@ -650,7 +644,6 @@ uniscribe_check_otf (LOGFONT *font, Lisp_Object otf_spec)
   struct frame * f;
   HDC context;
   HFONT check_font, old_font;
-  DWORD table;
   int i, retval = 0;
   struct gcpro gcpro1;
 
@@ -940,7 +933,11 @@ struct font_driver uniscribe_font_driver =
     NULL, /* otf_drive - use shape instead.  */
     NULL, /* start_for_frame */
     NULL, /* end_for_frame */
-    uniscribe_shape
+    uniscribe_shape,
+    NULL, /* check */
+    NULL, /* get_variation_glyphs */
+    NULL, /* filter_properties */
+    NULL, /* cached_font_ok */
   };
 
 /* Note that this should be called at every startup, not just when dumping,
@@ -964,6 +961,3 @@ syms_of_w32uniscribe (void)
 
   register_font_driver (&uniscribe_font_driver, NULL);
 }
-
-/* arch-tag: 9530f0e1-7471-47dd-a780-94330af87ea0
-   (do not change this comment) */