Fixing #599
This commit is contained in:
parent
3b3f134e35
commit
ecf0dd5bbb
13
fonts.js
13
fonts.js
@ -1219,16 +1219,12 @@ var Font = (function Font() {
|
|||||||
|
|
||||||
var encoding = properties.encoding, i;
|
var encoding = properties.encoding, i;
|
||||||
|
|
||||||
// offsetting glyphs to avoid problematic unicode ranges should only be
|
// offsetting glyphs to avoid problematic unicode ranges
|
||||||
// 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;
|
|
||||||
|
|
||||||
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 (canRemapAllGlyphs || unicode <= 0x1f ||
|
if (unicode <= 0x1f ||
|
||||||
(unicode >= 127 && unicode <= 255))
|
(unicode >= 127 && unicode < kSizeOfGlyphArea))
|
||||||
encoding[i].unicode += kCmapGlyphOffset;
|
encoding[i].unicode += kCmapGlyphOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1236,8 +1232,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: canRemapAllGlyphs ||
|
unicode: i <= 0x1f || (i >= 127 && i < kSizeOfGlyphArea) ?
|
||||||
i <= 0x1f || (i >= 127 && i < kSizeOfGlyphArea) ?
|
|
||||||
i + kCmapGlyphOffset : i
|
i + kCmapGlyphOffset : i
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user