]> code.delx.au - gnu-emacs/blobdiff - src/w32uniscribe.c
* frame.c (x_set_alpha) [NS_IMPL_COCOA]: Call x_set_frame_alpha.
[gnu-emacs] / src / w32uniscribe.c
index e987b112a672ea3e53fae36670532a74d07ea096..2522430224756bf5e3bb044e68479eb55192b00a 100644 (file)
@@ -34,6 +34,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "dispextern.h"
 #include "character.h"
 #include "charset.h"
+#include "composite.h"
 #include "fontset.h"
 #include "font.h"
 #include "w32font.h"
@@ -223,7 +224,7 @@ uniscribe_shape (lgstring)
   uniscribe_font = (struct uniscribe_font_info *) font;
 
   /* Get the chars from lgstring in a form we can use with uniscribe.  */
-  max_glyphs = nchars = LGSTRING_LENGTH (lgstring);
+  max_glyphs = nchars = LGSTRING_GLYPH_LEN (lgstring);
   done_glyphs = 0;
   chars = (wchar_t *) alloca (nchars * sizeof (wchar_t));
   for (i = 0; i < nchars; i++)
@@ -338,13 +339,18 @@ uniscribe_shape (lgstring)
                  int lglyph_index = j + done_glyphs;
                  Lisp_Object lglyph = LGSTRING_GLYPH (lgstring, lglyph_index);
                  ABC char_metric;
+                 unsigned gl;
 
                  if (NILP (lglyph))
                    {
                      lglyph = Fmake_vector (make_number (LGLYPH_SIZE), Qnil);
                      LGSTRING_SET_GLYPH (lgstring, lglyph_index, lglyph);
                    }
-                 LGLYPH_SET_CODE (lglyph, glyphs[j]);
+                 /* Copy to a 32-bit data type to shut up the
+                    compiler warning in LGLYPH_SET_CODE about
+                    comparison being always false.  */
+                 gl = glyphs[j];
+                 LGLYPH_SET_CODE (lglyph, gl);
 
                  /* Detect clusters, for linking codes back to characters.  */
                  if (attributes[j].fClusterStart)
@@ -518,9 +524,9 @@ uniscribe_encode_char (font, c)
               result = ScriptGetCMap (context, &(uniscribe_font->cache),
                                       ch, len, 0, glyphs);
               if (SUCCEEDED (result))
-                return glyphs[0];
+                code = glyphs[0];
               else
-                return 0; /* notdef - enough in some cases to get the script
+                code = 0; /* notdef - enough in some cases to get the script
                              engine working, but not others... */
             }
        }
@@ -728,10 +734,12 @@ int uniscribe_check_otf (font, otf_spec)
              OTF_INT16_VAL (tbl, scriptlist_table + 6 + j * 6, &script_table);
              break;
            }
+#if 0    /* Causes false positives.  */
          /* If there is a DFLT script defined in the font, use it
             if the specified script is not found.  */
          else if (script_id == default_script)
            OTF_INT16_VAL (tbl, scriptlist_table + 6 + j * 6, &script_table);
+#endif
        }
       /* If no specific or default script table was found, then this font
         does not support the script.  */