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

Add '^M' support in the ASCII85Decode filter and fix the fonts code to load the Type1 spec

This commit is contained in:
Vivien Nicolas 2011-09-05 22:09:40 +02:00
parent 3c77972b8e
commit 83f930abd6
2 changed files with 30 additions and 23 deletions

15
pdf.js
View file

@ -2358,7 +2358,7 @@ var Lexer = (function() {
}
constructor.isSpace = function(ch) {
return ch == ' ' || ch == '\t';
return ch == ' ' || ch == '\t' || ch == '\x0d';
};
// A '1' in this array means the character is white space. A '1' or
@ -4428,6 +4428,7 @@ var PartialEvaluator = (function() {
fontName = fontName.name.replace(/[\+,\-]/g, '_');
var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3');
var length1, length2;
if (fontFile) {
fontFile = xref.fetchIfRef(fontFile);
@ -4436,6 +4437,14 @@ var PartialEvaluator = (function() {
if (fileType)
fileType = fileType.name;
}
length1 = fontFile.dict.get('Length1');
if (!IsInt(length1))
length1 = xref.fetchIfRef(length1);
length2 = fontFile.dict.get('Length2');
if (!IsInt(length2))
length2 = xref.fetchIfRef(length2);
}
var widths = fontDict.get('Widths');
@ -4464,7 +4473,9 @@ var PartialEvaluator = (function() {
italicAngle: descriptor.get('ItalicAngle'),
fixedPitch: false,
textMatrix: IDENTITY_MATRIX,
compositeFont: compositeFont
compositeFont: compositeFont,
length1: length1,
length2: length2
};
return {