emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src w32uniscribe.c


From: Jason Rumney
Subject: [Emacs-diffs] emacs/src w32uniscribe.c
Date: Sun, 21 Dec 2008 15:51:29 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Jason Rumney <jasonr>   08/12/21 15:51:29

Modified files:
        src            : w32uniscribe.c 

Log message:
        (uniscribe_encode_char): Return FONT_INVALID_CHAR
        when character maps to .notdef character.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/w32uniscribe.c?cvsroot=emacs&r1=1.29&r2=1.30

Patches:
Index: w32uniscribe.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32uniscribe.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- w32uniscribe.c      13 Dec 2008 17:56:29 -0000      1.29
+++ w32uniscribe.c      21 Dec 2008 15:51:29 -0000      1.30
@@ -516,6 +516,9 @@
 
           if (SUCCEEDED (result) && nglyphs == 1)
             {
+             /* Some fonts return .notdef glyphs instead of failing.
+                (Truetype spec reserves glyph code 0 for .notdef)  */
+             if (glyphs[0])
               code = glyphs[0];
             }
           else if (SUCCEEDED (result) || result == E_OUTOFMEMORY)
@@ -526,11 +529,8 @@
                  later.  */
               result = ScriptGetCMap (context, &(uniscribe_font->cache),
                                       ch, len, 0, glyphs);
-              if (SUCCEEDED (result))
+              if (SUCCEEDED (result) && glyphs[0])
                 code = glyphs[0];
-              else
-                code = 0; /* notdef - enough in some cases to get the script
-                             engine working, but not others... */
             }
        }
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]