Merge pull request #3878 from yurydelendik/issue2799
Removes cvt when hints invalid
This commit is contained in:
commit
821b9b00d0
@ -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
|
||||
|
1
test/pdfs/issue2799.pdf.link
Normal file
1
test/pdfs/issue2799.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://dl.dropboxusercontent.com/s/15j936nuidw0e8d/SIMPLE-Vivace.pdf?token_hash=AAEwO6O_zfDfSxC3Zmpoy_cNfiR109Tn-REcWa32slkaSA&disable_range=1
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user