Merge pull request #3878 from yurydelendik/issue2799

Removes cvt when hints invalid
This commit is contained in:
Tim van der Meij 2013-11-08 12:51:09 -08:00
commit 821b9b00d0
3 changed files with 17 additions and 2 deletions

View File

@ -3647,7 +3647,7 @@ var Font = (function FontClosure() {
}
}
function sanitizeTTPrograms(fpgm, prep) {
function sanitizeTTPrograms(fpgm, prep, cvt) {
var ttContext = {
functionsDefined: [],
functionsUsed: [],
@ -3664,6 +3664,11 @@ var Font = (function FontClosure() {
if (fpgm) {
checkInvalidFunctions(ttContext, maxFunctionDefs);
}
if (cvt && (cvt.length & 1)) {
var cvtData = new Uint8Array(cvt.length + 1);
cvtData.set(cvt.data);
cvt.data = cvtData;
}
return ttContext.hintsValid;
}
@ -3735,10 +3740,11 @@ var Font = (function FontClosure() {
}
var hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep,
maxFunctionDefs);
tables['cvt '], maxFunctionDefs);
if (!hintsValid) {
delete tables.fpgm;
delete tables.prep;
delete tables['cvt '];
}
// Tables needs to be written by ascendant alphabetic order

View File

@ -0,0 +1 @@
https://dl.dropboxusercontent.com/s/15j936nuidw0e8d/SIMPLE-Vivace.pdf?token_hash=AAEwO6O_zfDfSxC3Zmpoy_cNfiR109Tn-REcWa32slkaSA&disable_range=1

View File

@ -1392,6 +1392,14 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue2799",
"file": "pdfs/issue2799.pdf",
"md5": "3d3224eae54bbae5fc76224a2af49486",
"rounds": 1,
"lastPage": 1,
"link": true,
"type": "eq"
},
{ "id": "issue3025",
"file": "pdfs/issue3025.pdf",
"md5": "8e4e8eacbd7c4c248deeca0ec49d38da",