Merge pull request #2243 from yurydelendik/issue-1233
Removes useless font tables for PDF rendering
This commit is contained in:
commit
336d5041dd
@ -3230,6 +3230,9 @@ var Font = (function FontClosure() {
|
||||
var requiredTables = ['OS/2', 'cmap', 'head', 'hhea',
|
||||
'hmtx', 'maxp', 'name', 'post'];
|
||||
|
||||
var optionalTables = ['cvt ', 'fpgm', 'glyf', 'loca', 'prep',
|
||||
'CFF ', 'VORG', 'vhea', 'vmtx'];
|
||||
|
||||
var header = readOpenTypeHeader(font);
|
||||
var numTables = header.numTables;
|
||||
|
||||
@ -3255,6 +3258,9 @@ var Font = (function FontClosure() {
|
||||
os2 = table;
|
||||
|
||||
requiredTables.splice(index, 1);
|
||||
} else if (optionalTables.indexOf(table.tag) < 0) {
|
||||
// skipping table if it's not a required or optional table
|
||||
continue;
|
||||
} else {
|
||||
if (table.tag == 'vmtx')
|
||||
vmtx = table;
|
||||
|
1
test/pdfs/issue1233.pdf.link
Normal file
1
test/pdfs/issue1233.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
http://princexml.com/samples/math.pdf
|
@ -609,6 +609,14 @@
|
||||
"link": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue1233",
|
||||
"file": "pdfs/issue1233.pdf",
|
||||
"md5": "2d3565b0a286e29955796c37c66326c1",
|
||||
"rounds": 1,
|
||||
"pageLimit": 1,
|
||||
"link": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "issue1243",
|
||||
"file": "pdfs/issue1243.pdf",
|
||||
"md5": "130c849b83513d5ac5e03c6421fc7489",
|
||||
|
Loading…
x
Reference in New Issue
Block a user