Address review comment for pull #419
This commit is contained in:
parent
59c4ba0fb9
commit
81e1485e14
33
fonts.js
33
fonts.js
@ -2207,32 +2207,29 @@ var Type2CFF = (function() {
|
||||
var nominalWidth = privDict['nominalWidthX'];
|
||||
|
||||
var charstrings = [];
|
||||
var differences = properties.differences;
|
||||
var index = 0, code = 0;
|
||||
var kCmapGlyphOffset = 0xE000;
|
||||
var differences = properties.differences;
|
||||
var index = 0;
|
||||
for (var i = 1; i < charsets.length; i++) {
|
||||
var code = -1;
|
||||
var glyph = charsets[i];
|
||||
if (differences.length) {
|
||||
for (var j = index; j < differences.length; j++) {
|
||||
if (differences[j]) {
|
||||
index = j;
|
||||
break;
|
||||
}
|
||||
for (var j = index; j < differences.length; j++) {
|
||||
if (differences[j]) {
|
||||
index = j;
|
||||
code = differences.indexOf(glyph);
|
||||
break;
|
||||
}
|
||||
|
||||
code = differences.indexOf(glyph);
|
||||
if (code == -1)
|
||||
code = properties.glyphs[glyph] || index;
|
||||
} else {
|
||||
code = GlyphsUnicode[glyph] || index;
|
||||
index = code;
|
||||
}
|
||||
|
||||
if (!code)
|
||||
continue;
|
||||
if (code == -1)
|
||||
index = code = properties.glyphs[glyph] || index;
|
||||
|
||||
var width = widths[code] || defaultWidth;
|
||||
properties.encoding[index] = index + kCmapGlyphOffset;
|
||||
charstrings.push({unicode: code + kCmapGlyphOffset, width: width, gid: i});
|
||||
charstrings.push({
|
||||
unicode: code + kCmapGlyphOffset,
|
||||
width: width, gid: i
|
||||
});
|
||||
index++;
|
||||
}
|
||||
|
||||
|
8
pdf.js
8
pdf.js
@ -4281,10 +4281,6 @@ var PartialEvaluator = (function() {
|
||||
case 'Type1':
|
||||
baseEncoding = Encodings.StandardEncoding.slice();
|
||||
break;
|
||||
case 'Type3':
|
||||
// There is no baseEncoding for a Type3 font, the 'Encoding'
|
||||
// entry is required and should provide a complete encoding
|
||||
break;
|
||||
default:
|
||||
warn('Unknown type of font: ' + fontType);
|
||||
break;
|
||||
@ -4308,10 +4304,6 @@ var PartialEvaluator = (function() {
|
||||
glyphsMap[glyph] = encodingMap[i] = GlyphsUnicode[glyph] || i;
|
||||
}
|
||||
|
||||
|
||||
if (fontType == 'Type3')
|
||||
log(glyphsMap);
|
||||
|
||||
if (fontType == 'TrueType' && fontDict.has('ToUnicode') && differences) {
|
||||
var cmapObj = xref.fetchIfRef(fontDict.get('ToUnicode'));
|
||||
if (IsName(cmapObj)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user