1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #2243 from yurydelendik/issue-1233

Removes useless font tables for PDF rendering
This commit is contained in:
Brendan Dahl 2012-10-15 17:04:28 -07:00
commit 336d5041dd
3 changed files with 15 additions and 0 deletions

View file

@ -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;