|
@@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
|
|
|
// Use strict in our context only - users might not want it
|
|
|
'use strict';
|
|
|
|
|
|
-var pdfjsVersion = '1.5.316';
|
|
|
-var pdfjsBuild = 'b9e9038';
|
|
|
+var pdfjsVersion = '1.5.318';
|
|
|
+var pdfjsBuild = '1f3f4a8';
|
|
|
|
|
|
var pdfjsFilePath =
|
|
|
typeof document !== 'undefined' && document.currentScript ?
|
|
@@ -31808,6 +31808,25 @@ function getFontType(type, subtype) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// Some bad PDF generators, e.g. Scribus PDF, include glyph names
|
|
|
+// in a 'uniXXXX' format -- attempting to recover proper ones.
|
|
|
+function recoverGlyphName(name, glyphsUnicodeMap) {
|
|
|
+ if (glyphsUnicodeMap[name] !== undefined) {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+ // The glyph name is non-standard, trying to recover.
|
|
|
+ var unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);
|
|
|
+ if (unicode !== -1) {
|
|
|
+ for (var key in glyphsUnicodeMap) {
|
|
|
+ if (glyphsUnicodeMap[key] === unicode) {
|
|
|
+ return key;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ warn('Unable to recover a standard glyph name for: ' + name);
|
|
|
+ return name;
|
|
|
+}
|
|
|
+
|
|
|
var Glyph = (function GlyphClosure() {
|
|
|
function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId,
|
|
|
isSpace, isInFont) {
|
|
@@ -33889,26 +33908,6 @@ var Font = (function FontClosure() {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- // Some bad PDF generators, e.g. Scribus PDF, include glyph names
|
|
|
- // in a 'uniXXXX' format -- attempting to recover proper ones.
|
|
|
- function recoverGlyphName(name, glyphsUnicodeMap) {
|
|
|
- if (glyphsUnicodeMap[name] !== undefined) {
|
|
|
- return name;
|
|
|
- }
|
|
|
- // The glyph name is non-standard, trying to recover.
|
|
|
- var unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);
|
|
|
- if (unicode !== -1) {
|
|
|
- for (var key in glyphsUnicodeMap) {
|
|
|
- if (glyphsUnicodeMap[key] === unicode) {
|
|
|
- return key;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- warn('Unable to recover a standard glyph name for: ' + name);
|
|
|
- return name;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
if (properties.type === 'CIDFontType2') {
|
|
|
var cidToGidMap = properties.cidToGidMap || [];
|
|
|
var isCidToGidMapEmpty = cidToGidMap.length === 0;
|
|
@@ -34482,11 +34481,21 @@ function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
|
|
|
}
|
|
|
|
|
|
// Lastly, merge in the differences.
|
|
|
- var differences = properties.differences;
|
|
|
+ var differences = properties.differences, glyphsUnicodeMap;
|
|
|
if (differences) {
|
|
|
for (charCode in differences) {
|
|
|
var glyphName = differences[charCode];
|
|
|
glyphId = glyphNames.indexOf(glyphName);
|
|
|
+
|
|
|
+ if (glyphId === -1) {
|
|
|
+ if (!glyphsUnicodeMap) {
|
|
|
+ glyphsUnicodeMap = getGlyphsUnicode();
|
|
|
+ }
|
|
|
+ var standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);
|
|
|
+ if (standardGlyphName !== glyphName) {
|
|
|
+ glyphId = glyphNames.indexOf(standardGlyphName);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (glyphId >= 0) {
|
|
|
charCodeToGlyphId[charCode] = glyphId;
|
|
|
} else {
|