Fixes glyphs with invalid flags

This commit is contained in:
Yury Delendik 2013-11-13 13:45:59 -06:00
parent a6e7f2226a
commit 82a9a13e5f
4 changed files with 11 additions and 2 deletions

View File

@ -3163,8 +3163,8 @@ var Font = (function FontClosure() {
for (var i = 0; i < flagsCount; i++) {
var flag = glyf[j++];
if (flag & 0xC0) {
// reserved flags must be zero, rejecting
return 0;
// reserved flags must be zero, cleaning up
glyf[j - 1] = flag & 0x3F;
}
var xyLength = ((flag & 2) ? 1 : (flag & 16) ? 0 : 2) +
((flag & 4) ? 1 : (flag & 32) ? 0 : 2);

View File

@ -46,6 +46,7 @@
!issue1002.pdf
!issue925.pdf
!gradientfill.pdf
!bug903856.pdf
!basicapi.pdf
!mixedfonts.pdf
!shading_extend.pdf

BIN
test/pdfs/bug903856.pdf Normal file

Binary file not shown.

View File

@ -1457,6 +1457,14 @@
"lastPage": 2,
"type": "eq"
},
{ "id": "bug903856",
"file": "pdfs/bug903856.pdf",
"md5": "286eaa9d06a5809f4f08f2093cef8f3f",
"rounds": 1,
"firstPage": 1,
"lastPage": 1,
"type": "eq"
},
{ "id": "issue3205",
"file": "pdfs/issue3205.pdf",
"md5": "e833326f69f2fdf7c1c8438fe1d3b622",