Fixes glyphs with invalid flags
This commit is contained in:
parent
a6e7f2226a
commit
82a9a13e5f
@ -3163,8 +3163,8 @@ var Font = (function FontClosure() {
|
|||||||
for (var i = 0; i < flagsCount; i++) {
|
for (var i = 0; i < flagsCount; i++) {
|
||||||
var flag = glyf[j++];
|
var flag = glyf[j++];
|
||||||
if (flag & 0xC0) {
|
if (flag & 0xC0) {
|
||||||
// reserved flags must be zero, rejecting
|
// reserved flags must be zero, cleaning up
|
||||||
return 0;
|
glyf[j - 1] = flag & 0x3F;
|
||||||
}
|
}
|
||||||
var xyLength = ((flag & 2) ? 1 : (flag & 16) ? 0 : 2) +
|
var xyLength = ((flag & 2) ? 1 : (flag & 16) ? 0 : 2) +
|
||||||
((flag & 4) ? 1 : (flag & 32) ? 0 : 2);
|
((flag & 4) ? 1 : (flag & 32) ? 0 : 2);
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -46,6 +46,7 @@
|
|||||||
!issue1002.pdf
|
!issue1002.pdf
|
||||||
!issue925.pdf
|
!issue925.pdf
|
||||||
!gradientfill.pdf
|
!gradientfill.pdf
|
||||||
|
!bug903856.pdf
|
||||||
!basicapi.pdf
|
!basicapi.pdf
|
||||||
!mixedfonts.pdf
|
!mixedfonts.pdf
|
||||||
!shading_extend.pdf
|
!shading_extend.pdf
|
||||||
|
BIN
test/pdfs/bug903856.pdf
Normal file
BIN
test/pdfs/bug903856.pdf
Normal file
Binary file not shown.
@ -1457,6 +1457,14 @@
|
|||||||
"lastPage": 2,
|
"lastPage": 2,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "bug903856",
|
||||||
|
"file": "pdfs/bug903856.pdf",
|
||||||
|
"md5": "286eaa9d06a5809f4f08f2093cef8f3f",
|
||||||
|
"rounds": 1,
|
||||||
|
"firstPage": 1,
|
||||||
|
"lastPage": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue3205",
|
{ "id": "issue3205",
|
||||||
"file": "pdfs/issue3205.pdf",
|
"file": "pdfs/issue3205.pdf",
|
||||||
"md5": "e833326f69f2fdf7c1c8438fe1d3b622",
|
"md5": "e833326f69f2fdf7c1c8438fe1d3b622",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user