Commiting: Issue 13243045: cmap format 4 fix: add idDelta to non-zero glyph ids for non-zero range offset



git-svn-id: http://sfntly.googlecode.com/svn/trunk@215 672e30a5-4c29-85ac-ac6d-611c735e0a51
diff --git a/java/src/com/google/typography/font/sfntly/table/core/CMapFormat4.java b/java/src/com/google/typography/font/sfntly/table/core/CMapFormat4.java
index 105a72a..6d20f71 100644
--- a/java/src/com/google/typography/font/sfntly/table/core/CMapFormat4.java
+++ b/java/src/com/google/typography/font/sfntly/table/core/CMapFormat4.java
@@ -58,8 +58,12 @@
     if (idRangeOffset == 0) {
       return (character + this.idDelta(segment)) % 65536;
     }
-    return this.data.readUShort(
+    int gid = this.data.readUShort(
         idRangeOffset + this.idRangeOffsetLocation(segment) + 2 * (character - startCode));
+    if (gid != 0) {
+      gid = (gid +  this.idDelta(segment)) % 65536;
+    }
+    return gid;
   }
 
   /**
@@ -503,4 +507,4 @@
       return index;
     }
   }
-}
\ No newline at end of file
+}