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

Fix wrong dict data offset when there is many charstrings

This commit is contained in:
Vivien Nicolas 2011-08-26 17:18:18 +02:00
parent 1cf4fc8782
commit 4a320705c0
2 changed files with 21 additions and 13 deletions

10
pdf.js
View file

@ -4294,6 +4294,10 @@ var PartialEvaluator = (function() {
if (fontDict.has('ToUnicode')) {
encodingMap['empty'] = true;
var glyphsMap = {};
for (var p in glyphMap)
glyphsMap[glyphMap[p]] = encodingMap[p];
var cmapObj = xref.fetchIfRef(fontDict.get('ToUnicode'));
if (IsName(cmapObj)) {
error('ToUnicode file cmap translation not implemented');
@ -4425,16 +4429,12 @@ var PartialEvaluator = (function() {
glyphWidths[unicode++] = widths[i];
}
var glyphsMap = {};
for (var p in glyphMap)
glyphsMap[glyphMap[p]] = encodingMap[p];
var properties = {
type: subType.name,
subtype: fileType,
widths: glyphWidths,
encoding: encodingMap,
glyphs: glyphsMap,
glyphs: glyphsMap || GlyphsUnicode,
builtInEncoding: builtInEncoding,
charset: charset,
firstChar: fontDict.get('FirstChar'),