Merge pull request #5770 from Snuffleupagus/opentype-cff
Correctly detect OpenType font files with CFF data
This commit is contained in:
commit
c69ad5885c
@ -2572,8 +2572,6 @@ var Font = (function FontClosure() {
|
|||||||
if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') {
|
if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') {
|
||||||
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') {
|
if (subtype === 'OpenType') {
|
||||||
type = 'OpenType';
|
type = 'OpenType';
|
||||||
}
|
}
|
||||||
@ -3980,7 +3978,8 @@ var Font = (function FontClosure() {
|
|||||||
var isTrueType = !tables['CFF '];
|
var isTrueType = !tables['CFF '];
|
||||||
if (!isTrueType) {
|
if (!isTrueType) {
|
||||||
// OpenType font
|
// 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
|
// no major tables: throwing everything at CFFFont
|
||||||
cffFile = new Stream(tables['CFF '].data);
|
cffFile = new Stream(tables['CFF '].data);
|
||||||
cff = new CFFFont(cffFile, properties);
|
cff = new CFFFont(cffFile, properties);
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -114,6 +114,7 @@
|
|||||||
!issue4722.pdf
|
!issue4722.pdf
|
||||||
!issue4800.pdf
|
!issue4800.pdf
|
||||||
!issue4801.pdf
|
!issue4801.pdf
|
||||||
|
!issue5334.pdf
|
||||||
!issue5549.pdf
|
!issue5549.pdf
|
||||||
!issue5475.pdf
|
!issue5475.pdf
|
||||||
!issue5481.pdf
|
!issue5481.pdf
|
||||||
|
BIN
test/pdfs/issue5334.pdf
Normal file
BIN
test/pdfs/issue5334.pdf
Normal file
Binary file not shown.
@ -421,6 +421,13 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "load"
|
"type": "load"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue5334",
|
||||||
|
"file": "pdfs/issue5334.pdf",
|
||||||
|
"md5": "5575020f37f6e5b3c43b8183bf7f96ae",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": false,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "bug850854",
|
{ "id": "bug850854",
|
||||||
"file": "pdfs/bug850854.pdf",
|
"file": "pdfs/bug850854.pdf",
|
||||||
"md5": "346a034a80120d123b9fefc42bcb11da",
|
"md5": "346a034a80120d123b9fefc42bcb11da",
|
||||||
|
Loading…
Reference in New Issue
Block a user