Only offset glyphs that can fit into the private use area

This commit is contained in:
Adil Allawi 2011-10-04 14:18:33 +01:00
parent 179533a06c
commit 3645ebe42c

View File

@ -1225,7 +1225,7 @@ var Font = (function Font() {
for (i in encoding) { for (i in encoding) {
if (encoding.hasOwnProperty(i)) { if (encoding.hasOwnProperty(i)) {
var unicode = encoding[i].unicode; var unicode = encoding[i].unicode;
if (unicode <= 0x1f || (unicode >= 127 && unicode <= kUnicodeCJKStart)) if (unicode <= 0x1f || (unicode >= 127 && unicode <= kSizeOfGlyphArea))
encoding[i].unicode = unicode += cmapGlyphOffset; encoding[i].unicode = unicode += cmapGlyphOffset;
} }
} }
@ -1233,7 +1233,7 @@ var Font = (function Font() {
var glyphs = []; var glyphs = [];
for (i = 1; i < numGlyphs; i++) { for (i = 1; i < numGlyphs; i++) {
glyphs.push({ glyphs.push({
unicode: i <= 0x1f || (i >= 127 && i < kUnicodeCJKStart) ? unicode: i <= 0x1f || (i >= 127 && i < kSizeOfGlyphArea) ?
i + cmapGlyphOffset : i i + cmapGlyphOffset : i
}); });
} }