mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Merge pull request #2050 from yurydelendik/issue-2040
Fixes incorrect font type and prevents future this.objs.objs[fonts[i]] ...
This commit is contained in:
commit
8e50da78ee
2 changed files with 35 additions and 4 deletions
22
src/fonts.js
22
src/fonts.js
|
@ -1577,13 +1577,19 @@ var Font = (function FontClosure() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Some fonts might use wrong font types for Type1C or CIDFontType0C
|
||||
var subtype = properties.subtype;
|
||||
if (subtype == 'Type1C' && (type != 'Type1' && type != 'MMType1'))
|
||||
type = 'Type1';
|
||||
if (subtype == 'CIDFontType0C' && type != 'CIDFontType0')
|
||||
type = 'CIDFontType0';
|
||||
|
||||
var data;
|
||||
switch (type) {
|
||||
case 'Type1':
|
||||
case 'CIDFontType0':
|
||||
this.mimetype = 'font/opentype';
|
||||
|
||||
var subtype = properties.subtype;
|
||||
var cff = (subtype == 'Type1C' || subtype == 'CIDFontType0C') ?
|
||||
new CFFFont(file, properties) : new Type1Font(name, file, properties);
|
||||
|
||||
|
@ -3310,6 +3316,20 @@ var Font = (function FontClosure() {
|
|||
return Font;
|
||||
})();
|
||||
|
||||
var ErrorFont = (function ErrorFontClosure() {
|
||||
function ErrorFont(error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
ErrorFont.prototype = {
|
||||
charsToGlyphs: function ErrorFont_charsToGlyphs() {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
return ErrorFont;
|
||||
})();
|
||||
|
||||
var CallothersubrCmd = (function CallothersubrCmdClosure() {
|
||||
function CallothersubrCmd(index) {
|
||||
this.index = index;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue