1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Move all format 0 characters to the private area

This commit is contained in:
Vivien Nicolas 2011-09-05 17:30:01 +02:00
parent 5970020f3b
commit 9701f934ed
2 changed files with 8 additions and 12 deletions

6
pdf.js
View file

@ -4297,6 +4297,10 @@ var PartialEvaluator = (function() {
lastChar = diffEncoding.length || baseEncoding.length;
// merge in the differences
function isDisplayable(code) {
return code > 0x1f && (code < 128 || code > 255);
}
var glyphsMap = {};
for (var i = firstChar; i <= lastChar; i++) {
var glyph = diffEncoding[i] || baseEncoding[i];
@ -4304,7 +4308,7 @@ var PartialEvaluator = (function() {
var index = GlyphsUnicode[glyph] || i;
glyphsMap[glyph] = encodingMap[i] = index;
if (index <= 0x1f || (index >= 127 && index <= 255))
if (!isDisplayable(index))
glyphsMap[glyph] = encodingMap[i] += kCmapGlyphOffset;
}