[Pkg-javascript-commits] [pdf.js] 127/157: Adjust the heuristics used to detect OpenType font file with CFF data (bug 1186827, bug 1182130, issue 6264)
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 06:46:48 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 0a024b50516f29fda69794df5c26d56400fb8f0a
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Sat Jul 25 12:26:36 2015 +0200
Adjust the heuristics used to detect OpenType font file with CFF data (bug 1186827, bug 1182130, issue 6264)
*This is a tentative patch.*
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1186827.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1182130.
Fixes 6264.
---
src/core/fonts.js | 2 +-
test/pdfs/.gitignore | 2 ++
test/pdfs/bug1186827.pdf | Bin 0 -> 45013 bytes
test/pdfs/issue215.pdf | Bin 0 -> 82195 bytes
test/test_manifest.json | 14 ++++++++++++++
5 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/core/fonts.js b/src/core/fonts.js
index 08f5c08..5dfbab3 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -4053,7 +4053,7 @@ var Font = (function FontClosure() {
var isTrueType = !tables['CFF '];
if (!isTrueType) {
// OpenType font
- if (header.version === 'OTTO' ||
+ if ((header.version === 'OTTO' && properties.type !== 'CIDFontType2') ||
!tables.head || !tables.hhea || !tables.maxp || !tables.post) {
// no major tables: throwing everything at CFFFont
cffFile = new Stream(tables['CFF '].data);
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index a79dc29..c4258e0 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -132,6 +132,8 @@
!issue4800.pdf
!issue4801.pdf
!issue5334.pdf
+!bug1186827.pdf
+!issue215.pdf
!issue5540.pdf
!issue5549.pdf
!issue5475.pdf
diff --git a/test/pdfs/bug1186827.pdf b/test/pdfs/bug1186827.pdf
new file mode 100644
index 0000000..a3a5be3
Binary files /dev/null and b/test/pdfs/bug1186827.pdf differ
diff --git a/test/pdfs/issue215.pdf b/test/pdfs/issue215.pdf
new file mode 100644
index 0000000..fa970e1
Binary files /dev/null and b/test/pdfs/issue215.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 5ecd5b7..dc7872d 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -435,6 +435,20 @@
"link": false,
"type": "eq"
},
+ { "id": "bug1186827",
+ "file": "pdfs/bug1186827.pdf",
+ "md5": "6c5526ae1a9d66cb517153001afc196e",
+ "rounds": 1,
+ "link": false,
+ "type": "eq"
+ },
+ { "id": "issue215",
+ "file": "pdfs/issue215.pdf",
+ "md5": "31f3dc60ecf008987d970edfd2b1df61",
+ "rounds": 1,
+ "link": false,
+ "type": "eq"
+ },
{ "id": "bug850854",
"file": "pdfs/bug850854.pdf",
"md5": "346a034a80120d123b9fefc42bcb11da",
--
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