emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114112: * nsfont.m (INVALID_GLYPH): New define.


From: Jan D.
Subject: [Emacs-diffs] trunk r114112: * nsfont.m (INVALID_GLYPH): New define.
Date: Tue, 03 Sep 2013 06:57:36 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114112
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15138
committer: Jan Djärv <address@hidden>
branch nick: trunk
timestamp: Tue 2013-09-03 08:56:25 +0200
message:
  * nsfont.m (INVALID_GLYPH): New define.
  (nsfont_encode_char): Use INVALID_GLYPH.
  (ns_uni_to_glyphs): Ditto, check for NSNullGlyph.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/nsfont.m                   nsfont.m-20091113204419-o5vbwnq5f7feedwu-8748
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-09-02 17:23:26 +0000
+++ b/src/ChangeLog     2013-09-03 06:56:25 +0000
@@ -1,3 +1,9 @@
+2013-09-03  Jan Djärv  <address@hidden>
+
+       * nsfont.m (INVALID_GLYPH): New define.
+       (nsfont_encode_char): Use INVALID_GLYPH.
+       (ns_uni_to_glyphs): Ditto, check for NSNullGlyph (Bug#15138).
+
 2013-09-02  Dmitry Antipov  <address@hidden>
 
        * xterm.c (x_last_mouse_movement_time): Revert last change.

=== modified file 'src/nsfont.m'
--- a/src/nsfont.m      2013-08-09 12:25:34 +0000
+++ b/src/nsfont.m      2013-09-03 06:56:25 +0000
@@ -61,6 +61,7 @@
 static void ns_glyph_metrics (struct nsfont_info *font_info,
                               unsigned char block);
 
+#define INVALID_GLYPH 0xFFFF
 
 /* ==========================================================================
 
@@ -981,7 +982,7 @@
     ns_uni_to_glyphs (font_info, high);
 
   g = font_info->glyphs[high][low];
-  return g == 0xFFFF ? FONT_INVALID_CODE : g;
+  return g == INVALID_GLYPH ? FONT_INVALID_CODE : g;
 }
 
 
@@ -1354,8 +1355,8 @@
 #else
         g = glyphStorage->cglyphs[i];
         /* TODO: is this a good check?  maybe need to use coveredChars.. */
-        if (g > numGlyphs)
-          g = 0xFFFF; /* hopefully unused... */
+        if (g > numGlyphs || g == NSNullGlyph)
+          g = INVALID_GLYPH; /* hopefully unused... */
 #endif
         *glyphs = g;
       }
@@ -1483,7 +1484,7 @@
         characterIndex: (NSUInteger)charIndex
 {
   len = glyphIndex+length;
-  for (i =glyphIndex; i<len; i++)
+  for (i =glyphIndex; i<len; i++) 
     cglyphs[i] = glyphs[i-glyphIndex];
   if (len > maxGlyph)
     maxGlyph = len;


reply via email to

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