From 5efccea2afb8c928c3c236370c86d150ffa8eb6d Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Sat, 18 Feb 2012 16:45:47 -0600 Subject: [PATCH] Using the first glyph code to detect the base glyph offset. --- src/fonts.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fonts.js b/src/fonts.js index cdb56efa7..b7dec9a94 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -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++) {