shithub: freetype+ttf2subf

Download patch

ref: 20abe742a77f1b88ceec0d2d651cc3ac5f242d88
parent: ec342907b3d98f34d9f8b0f8c37c8ebf25f55ead
author: Werner Lemberg <[email protected]>
date: Mon Sep 10 09:11:52 EDT 2001

* src/sfnt/ttcmap.c (code_to_index2): Handle code values with
hi-byte == 0 correctly.

* builds/link-std.mk ($(PROJECT_LIBRARY)): Fix typo.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-09-10  Yao Zhang  <[email protected]>
+
+	* src/sfnt/ttcmap.c (code_to_index2): Handle code values with
+	hi-byte == 0 correctly.
+
+2001-09-10  Werner Lemberg  <[email protected]>
+
+	* builds/link-std.mk ($(PROJECT_LIBRARY)): Fix typo.
+
 2001-08-30  Martin Muskens  <[email protected]>
 
 	* src/type1/t1load.c (parse_font_matrix): A new way to compute the
--- a/builds/link_dos.mk
+++ b/builds/link_dos.mk
@@ -34,7 +34,7 @@
     ifdef CLEAN_LIBRARY
 	  -$(CLEAN_LIBRARY) $(NO_OUTPUT)
     endif
-	$(LINK_LIBRARY)
+	  $(LINK_LIBRARY)
 
 endif
 
--- a/builds/link_std.mk
+++ b/builds/link_std.mk
@@ -32,9 +32,9 @@
   #
   $(PROJECT_LIBRARY): $(OBJECTS_LIST)
     ifdef CLEAN_LIBRARY
-	-$(CLEAN_LIBRARY) xx $(NO_OUTPUT)
+	  -$(CLEAN_LIBRARY) $(NO_OUTPUT)
     endif
-	$(LINK_LIBRARY)
+	  $(LINK_LIBRARY)
 
 endif
 
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -503,28 +503,29 @@
     {
       /* an 8-bit character code -- we use the subHeader 0 in this case */
       /* to test whether the character code is in the charmap           */
-      if ( cmap2->subHeaderKeys[char_lo] == 0 )
-        result = cmap2->glyphIdArray[char_lo];
+      index1 = cmap2->subHeaderKeys[char_lo];
+      if ( index1 != 0 )
+        return 0;
     }
     else
     {
       /* a 16-bit character code */
       index1 = cmap2->subHeaderKeys[char_hi & 0xFF];
-      if ( index1 )
-      {
-        sh2      = cmap2->subHeaders + index1;
-        char_lo -= sh2->firstCode;
+      if ( index1 == 0 )
+        return 0;
+    }
 
-        if ( char_lo < (FT_UInt)sh2->entryCount )
-        {
-          offset = sh2->idRangeOffset / 2 + char_lo;
-          if ( offset < (FT_UInt)cmap2->numGlyphId )
-          {
-            result = cmap2->glyphIdArray[offset];
-            if ( result )
-              result = ( result + sh2->idDelta ) & 0xFFFF;
-          }
-        }
+    sh2      = cmap2->subHeaders + index1;
+    char_lo -= sh2->firstCode;
+
+    if ( char_lo < (FT_UInt)sh2->entryCount )
+    {
+      offset = sh2->idRangeOffset / 2 + char_lo;
+      if ( offset < (FT_UInt)cmap2->numGlyphId )
+      {
+        result = cmap2->glyphIdArray[offset];
+        if ( result )
+          result = ( result + sh2->idDelta ) & 0xFFFF;
       }
     }