From ecf0dd5bbb4c24a5971c25be9b3497f3b4c5bc1a Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Wed, 5 Oct 2011 21:15:41 -0500 Subject: [PATCH] Fixing #599 --- fonts.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fonts.js b/fonts.js index 5477ae4ac..7d9b48465 100644 --- a/fonts.js +++ b/fonts.js @@ -1219,16 +1219,12 @@ var Font = (function Font() { var encoding = properties.encoding, i; - // offsetting glyphs to avoid problematic unicode ranges should only be - // done for fonts with a medium-sized glyph count otherwise we could - // overflow the glyph range or overwrite existing glyph positions - var canRemapAllGlyphs = numGlyphs < kSizeOfGlyphArea; - + // offsetting glyphs to avoid problematic unicode ranges for (i in encoding) { if (encoding.hasOwnProperty(i)) { var unicode = encoding[i].unicode; - if (canRemapAllGlyphs || unicode <= 0x1f || - (unicode >= 127 && unicode <= 255)) + if (unicode <= 0x1f || + (unicode >= 127 && unicode < kSizeOfGlyphArea)) encoding[i].unicode += kCmapGlyphOffset; } } @@ -1236,8 +1232,7 @@ var Font = (function Font() { var glyphs = []; for (i = 1; i < numGlyphs; i++) { glyphs.push({ - unicode: canRemapAllGlyphs || - i <= 0x1f || (i >= 127 && i < kSizeOfGlyphArea) ? + unicode: i <= 0x1f || (i >= 127 && i < kSizeOfGlyphArea) ? i + kCmapGlyphOffset : i }); }