Fall back to the |defaultEncoding| when no valid "post" table is found in TrueType fonts (bug 1050040)

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1050040.

With this patch the file is completely readable, but given that the font is broken enough to be rejected by OTS the rendering differs slightly from Adobe Reader.

*Note:* the PDF file is sufficiently broken that even Adobe Reader complains about the font, *and* also about another more general issue.
This commit is contained in:
Jonas Jenwald 2015-04-02 16:26:14 +02:00
parent 70b839386a
commit 0365baf5ab
4 changed files with 11 additions and 0 deletions

View File

@ -3697,6 +3697,9 @@ var Font = (function FontClosure() {
default:
warn('Unknown/unsupported post table version ' + version);
valid = false;
if (properties.defaultEncoding) {
glyphNames = properties.defaultEncoding;
}
break;
}
properties.glyphNames = glyphNames;

View File

@ -12,6 +12,7 @@
!arial_unicode_ab_cidfont.pdf
!arial_unicode_en_cidfont.pdf
!asciihexdecode.pdf
!bug1050040.pdf
!canvas.pdf
!complex_ttf_font.pdf
!extgstate.pdf

BIN
test/pdfs/bug1050040.pdf Normal file

Binary file not shown.

View File

@ -579,6 +579,13 @@
"link": false,
"type": "eq"
},
{ "id": "bug1050040",
"file": "pdfs/bug1050040.pdf",
"md5": "9076b29bd157e2646b457f29a4472a07",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "hudsonsurvey",
"file": "pdfs/hudsonsurvey.pdf",
"md5": "bf0e6576a7b6c2fe7485bce1b78e006f",