Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly detect OpenType font files with CFF data #5770

Merged
merged 1 commit into from
Mar 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/core/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2572,8 +2572,6 @@ var Font = (function FontClosure() {
if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') {
type = 'CIDFontType0';
}
// XXX: Temporarily change the type for open type so we trigger a warning.
// This should be removed when we add support for open type.
if (subtype === 'OpenType') {
type = 'OpenType';
}
Expand Down Expand Up @@ -3980,7 +3978,8 @@ var Font = (function FontClosure() {
var isTrueType = !tables['CFF '];
if (!isTrueType) {
// OpenType font
if (!tables.head || !tables.hhea || !tables.maxp || !tables.post) {
if (header.version === 'OTTO' ||
!tables.head || !tables.hhea || !tables.maxp || !tables.post) {
// no major tables: throwing everything at CFFFont
cffFile = new Stream(tables['CFF '].data);
cff = new CFFFont(cffFile, properties);
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
!issue4722.pdf
!issue4800.pdf
!issue4801.pdf
!issue5334.pdf
!issue5549.pdf
!issue5475.pdf
!issue5481.pdf
Expand Down
Binary file added test/pdfs/issue5334.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,13 @@
"rounds": 1,
"type": "load"
},
{ "id": "issue5334",
"file": "pdfs/issue5334.pdf",
"md5": "5575020f37f6e5b3c43b8183bf7f96ae",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "bug850854",
"file": "pdfs/bug850854.pdf",
"md5": "346a034a80120d123b9fefc42bcb11da",
Expand Down