Merge with upstream
This commit is contained in:
parent
3cc9912acd
commit
6311977fee
27
fonts.js
27
fonts.js
@ -532,18 +532,6 @@ var Font = (function Font() {
|
|||||||
ranges.push([start, end]);
|
ranges.push([start, end]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removes duplicate ranges
|
|
||||||
/*
|
|
||||||
for (var i = ranges.length - 1; i > 0; i--) {
|
|
||||||
var range = ranges[i];
|
|
||||||
var prevRange = ranges[i - 1];
|
|
||||||
if (range[0] <= prevRange[1]) {
|
|
||||||
range[0] = prevRange[0] - 2;
|
|
||||||
ranges.splice(i - 1, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return ranges;
|
return ranges;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -840,6 +828,21 @@ var Font = (function Font() {
|
|||||||
glyphs.push({ unicode : j });
|
glyphs.push({ unicode : j });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rewrite = false;
|
||||||
|
for (var code in encoding) {
|
||||||
|
if (code < 0x20 && encoding[code])
|
||||||
|
rewrite = true;
|
||||||
|
|
||||||
|
if (rewrite)
|
||||||
|
encoding[code] = parseInt(code) + 0x1F;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rewrite) {
|
||||||
|
for (var j = 0; j < glyphs.length; j++) {
|
||||||
|
glyphs[j].unicode += 0x1F;
|
||||||
|
}
|
||||||
|
}
|
||||||
cmap.data = createCMapTable(glyphs, deltas);
|
cmap.data = createCMapTable(glyphs, deltas);
|
||||||
} else if (format == 6 && numRecords == 1 && !encoding.empty) {
|
} else if (format == 6 && numRecords == 1 && !encoding.empty) {
|
||||||
// Format 0 alone is not allowed by the sanitizer so let's rewrite
|
// Format 0 alone is not allowed by the sanitizer so let's rewrite
|
||||||
|
6
pdf.js
6
pdf.js
@ -3733,7 +3733,11 @@ var PartialEvaluator = (function() {
|
|||||||
var index = 0;
|
var index = 0;
|
||||||
for (var j = 0; j < differences.length; j++) {
|
for (var j = 0; j < differences.length; j++) {
|
||||||
var data = differences[j];
|
var data = differences[j];
|
||||||
IsNum(data) ? index = data : encodingMap[index++] = data;
|
if (subType.name == 'TrueType') {
|
||||||
|
IsNum(data) ? index = data : encodingMap[index++] = j;
|
||||||
|
} else {
|
||||||
|
IsNum(data) ? index = data : encodingMap[index++] = GlyphsUnicode[data.name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the font charset if any
|
// Get the font charset if any
|
||||||
|
Loading…
Reference in New Issue
Block a user