[Pkg-javascript-commits] [pdf.js] 22/106: Fall back to the |defaultEncoding| when no valid "post" table is found in TrueType fonts (bug 1050040)
David Prévot
taffit at moszumanska.debian.org
Sat Jun 20 21:33:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 0365baf5ab8a88d46017bada9f0107fe5433e00e
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Thu Apr 2 16:26:14 2015 +0200
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.
---
src/core/fonts.js | 3 +++
test/pdfs/.gitignore | 1 +
test/pdfs/bug1050040.pdf | Bin 0 -> 40946 bytes
test/test_manifest.json | 7 +++++++
4 files changed, 11 insertions(+)
diff --git a/src/core/fonts.js b/src/core/fonts.js
index a22e7a1..9a31044 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -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;
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 1c24b05..63986d1 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -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
diff --git a/test/pdfs/bug1050040.pdf b/test/pdfs/bug1050040.pdf
new file mode 100644
index 0000000..8234544
Binary files /dev/null and b/test/pdfs/bug1050040.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 13269f2..e67d354 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -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",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list