1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 07:37:57 +02:00

Fix lying sfnt header for some CFF font that pretend to be TrueType and fix unknown unicode glyphs when building from Type1

This commit is contained in:
Vivien Nicolas 2011-08-26 14:21:25 +02:00
parent c6e4dadf94
commit 9ce69f94a6
2 changed files with 14 additions and 7 deletions

9
pdf.js
View file

@ -4392,7 +4392,9 @@ var PartialEvaluator = (function() {
var descriptor = xref.fetch(fd);
var fontName = xref.fetchIfRef(descriptor.get('FontName'));
var fontName = fontDict.get('Name');
if (!fontName)
fontName = xref.fetchIfRef(descriptor.get('FontName'));;
assertWellFormed(IsName(fontName), 'invalid font name');
fontName = fontName.name.replace(/[\+,\-]/g, '_');
@ -4423,11 +4425,16 @@ 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,
builtInEncoding: builtInEncoding,
charset: charset,
firstChar: fontDict.get('FirstChar'),