Fix loading of fonts with empty font files (bug 866395 and issue 3522)
This commit is contained in:
parent
ea0453f106
commit
3e1db41ddd
@ -2204,7 +2204,13 @@ var Font = (function FontClosure() {
|
|||||||
this.defaultVMetrics = properties.defaultVMetrics;
|
this.defaultVMetrics = properties.defaultVMetrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file) {
|
if (!file || file.isEmpty) {
|
||||||
|
if (file) {
|
||||||
|
// Some bad PDF generators will include empty font files,
|
||||||
|
// attempting to recover by assuming that no file exists.
|
||||||
|
warn('Font file is empty in "' + name + '" (' + this.loadedName + ')');
|
||||||
|
}
|
||||||
|
|
||||||
this.missingFile = true;
|
this.missingFile = true;
|
||||||
// The file data is not specified. Trying to fix the font name
|
// The file data is not specified. Trying to fix the font name
|
||||||
// to be used with the canvas.font.
|
// to be used with the canvas.font.
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -55,6 +55,7 @@
|
|||||||
!gradientfill.pdf
|
!gradientfill.pdf
|
||||||
!bug903856.pdf
|
!bug903856.pdf
|
||||||
!bug850854.pdf
|
!bug850854.pdf
|
||||||
|
!bug866395.pdf
|
||||||
!basicapi.pdf
|
!basicapi.pdf
|
||||||
!mixedfonts.pdf
|
!mixedfonts.pdf
|
||||||
!shading_extend.pdf
|
!shading_extend.pdf
|
||||||
|
BIN
test/pdfs/bug866395.pdf
Normal file
BIN
test/pdfs/bug866395.pdf
Normal file
Binary file not shown.
@ -682,6 +682,14 @@
|
|||||||
"type": "eq",
|
"type": "eq",
|
||||||
"about": "Seac with differences array that messes up mapping."
|
"about": "Seac with differences array that messes up mapping."
|
||||||
},
|
},
|
||||||
|
{ "id": "bug866395",
|
||||||
|
"file": "pdfs/bug866395.pdf",
|
||||||
|
"md5": "f03bc77e84637241980b09a0a220f575",
|
||||||
|
"link": false,
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq",
|
||||||
|
"about": "Font with an empty font file."
|
||||||
|
},
|
||||||
{ "id": "ocs",
|
{ "id": "ocs",
|
||||||
"file": "pdfs/ocs.pdf",
|
"file": "pdfs/ocs.pdf",
|
||||||
"md5": "2ade57e954ae7632749cf328daeaa7a8",
|
"md5": "2ade57e954ae7632749cf328daeaa7a8",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user