]> git.parisson.com Git - pdf.js.git/commitdiff
Using the first glyph code to detect the base glyph offset.
authornotmasteryet <async.processingjs@yahoo.com>
Sat, 18 Feb 2012 22:45:47 +0000 (16:45 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Sat, 18 Feb 2012 22:45:47 +0000 (16:45 -0600)
src/fonts.js

index cdb56efa784d0869817f0e31f36ce4d5c6d37c2a..b7dec9a94b25464be3e13ae37ef082b396cb35e3 100644 (file)
@@ -1940,10 +1940,11 @@ var Font = (function FontClosure() {
           }
         }
 
-        // If font is symbolic and cmap (3,0) present, the characters are
-        // located in 0xF000 - 0xF0FF range
-        this.symbolicGlyphsOffset =
-          this.isSymbolicFont && !hasShortCmap ? 0xF000 : 0;
+        // If font is symbolic and cmap (3,0) present, the characters can be
+        // located in 0xF000 - 0xF0FF range. Using the first glyph code
+        // to detect the base glyphs offset.
+        this.symbolicGlyphsOffset = this.isSymbolicFont && !hasShortCmap ?
+          (glyphs[i].unicode & 0xFF00) : 0;
 
         // remove glyph references outside range of avaialable glyphs
         for (var i = 0, ii = ids.length; i < ii; i++) {