Merge pull request #594 from notmasteryet/bypasstype3

Properly bypass Type3 fonts (ref #577)
This commit is contained in:
notmasteryet 2011-10-02 18:09:35 -07:00
commit f1228ee121

9
pdf.js
View File

@ -4563,6 +4563,8 @@ var PartialEvaluator = (function partialEvaluator() {
break;
default:
warn('Unknown type of font: ' + type);
baseEncoding = [];
break;
}
}
@ -4749,9 +4751,10 @@ var PartialEvaluator = (function partialEvaluator() {
// This case is here for compatibility.
var descriptor = xref.fetchIfRef(dict.get('FontDescriptor'));
if (!descriptor) {
var baseFontName = dict.get('BaseFont');
if (!isName(baseFontName))
return null;
// Note for Type3 fonts: it has no no base font, feeding default
// font name and trying to get font metrics as the same way as for
// a font without descriptor.
var baseFontName = dict.get('BaseFont') || new Name('sans-serif');
// Using base font name as a font name.
baseFontName = baseFontName.name.replace(/,/g, '_');