diff --git a/src/core/fonts.js b/src/core/fonts.js index 9deb55d18..5f96a8b93 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -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); diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 01a562b80..2f60ac8d3 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -46,6 +46,7 @@ !issue1002.pdf !issue925.pdf !gradientfill.pdf +!bug903856.pdf !basicapi.pdf !mixedfonts.pdf !shading_extend.pdf diff --git a/test/pdfs/bug903856.pdf b/test/pdfs/bug903856.pdf new file mode 100644 index 000000000..334d23736 Binary files /dev/null and b/test/pdfs/bug903856.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 82ada5c10..9eab256aa 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -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",