From 3c759e296a81241be7443d9b2d33fe7f1b39019c Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 18 Sep 2014 16:10:46 +0200 Subject: [PATCH] Add support for MMType1 fonts with embedded font files --- src/core/fonts.js | 3 +++ test/pdfs/.gitignore | 1 + test/pdfs/mmtype1.pdf | Bin 0 -> 8044 bytes test/test_manifest.json | 7 +++++++ 4 files changed, 11 insertions(+) create mode 100644 test/pdfs/mmtype1.pdf diff --git a/src/core/fonts.js b/src/core/fonts.js index ccba800cf..eff8181c7 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -2546,6 +2546,9 @@ var Font = (function FontClosure() { var data; switch (type) { + case 'MMType1': + info('MMType1 font (' + name + '), falling back to Type1.'); + /* falls through */ case 'Type1': case 'CIDFontType0': this.mimetype = 'font/opentype'; diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 7a0ac0709..94c9c87a9 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -55,6 +55,7 @@ !helloworld-bad.pdf !zerowidthline.pdf !bug868745.pdf +!mmtype1.pdf !bug864847.pdf !issue1002.pdf !issue925.pdf diff --git a/test/pdfs/mmtype1.pdf b/test/pdfs/mmtype1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..84786069e816b60789eeb8d410e35ff69b080045 GIT binary patch literal 8044 zcmd6Mby!s0w=f7214v0KFcQ)-J(P4wNw>fN0}Rd3CEaC9BMpjx2oj=_(h4HoA&R6* z2ngOYD(~xk?(g~T{qvji?6db-z1H4qZ5|e%j*^Nf^b#5bhr_@Su)B>DNLm^sW)R?k z1&b+SyfH5B4j?fdj04sS42Q!35XhC9HSUVg>!QCHh4)8$0 zFbD*Ugn+Ms#1!3q+`Pe1keCL}&I`c8;Ru3M0QI+A0_=avC0K&T0_-QIi0NUy+zIBE$hOl^|CM z>t&0_d3d|y!EhM#mjE$MjF-2fBL)wKAz>gfW1OA0Bf%vk0&o~X5P9;Tkc8+G9t4U2 z2k5~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0kh8T zRBK-3csP&(#%tjiZK0Lz(wy_)&cQdVAOX2Gs_)(0bLd;CG*=7cSWTB%$#wcMfCN zosT=;F1NqMLbJofq%u+yW++(g>O^lsWu?9_bDe+bp6DI$klgN(tJBLj@-!D6Ltk#l z$lu$_8(Z0HG`r5c z_6@}<`A^85IHHHU-K&giL5iK^K0_%X1rt$^rWR}l6x_7!!___-H4I3)u;Hg%sE^~k zj?Xlm%T>(PIDR0M8h*(#XQ1;)-5^MYWhFW!IyE@?E^3c?+OD~RJd`+B^;UOz;#8lQ z$=Nf8TUX8C<>wx4c-Fkn$~kY_$POy<$(k2!lza@+{dUtfV_C`nyndGZnxRLbypNdC zYpyJ!N>Q+6UOe3mBq`ERzFM#v6*SNLn$DuF! z?d~*H#oPYvaEfD%D1P>NoHjmtHBHGsFo!2c=U8N#@y83dhmP8xM_edhu};%VZ9J>B ze0-P1%_884GRK1L^ZN7>s@lD7ojWW|-Qe<3%P~(QWBY*36GN9;o2p@T)dYtQ_=u>! z>0Cd*EKQ%0tJnh1aq`Ro?SZofo5nuA<@JR-J3n(2E|cPZ5KA7JjK?b!7yfuZ?wFF{ ze8q5V$$b&^5<0NBFB} z@BCxlrPYRT6?i z!rF&O@lAAUYp?ZcDHWvCtljDDFaMTKYMMTjcvqX(9lsp3^6E4z5vd_N*Z=s}u0I}Y z4}t(KTgX2@FbYX%9@^7@2)$4!%^wsL3UvK`5rN$ZDA->p1kir`3kCld1%nd0KZM_J zF7dxmFeuP2{Rai~sQ=Lg0RPqn^rrtpp@8Przg&pFP*9*d`WFiM7Yg>@xlsS2pb$dW z_C%mJ9s{(M@V^@6`nW(WSOO%b=k8AEO8@Su{pyKf@ZP@yhektDAU;0jt1ABm-RFR( literal 0 HcmV?d00001 diff --git a/test/test_manifest.json b/test/test_manifest.json index defee9e02..00db5533f 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -235,6 +235,13 @@ "rounds": 1, "type": "eq" }, + { "id": "mmtype1", + "file": "pdfs/mmtype1.pdf", + "md5": "7d632263d28bc2ff05ee0cc426966a5a", + "link": false, + "rounds": 1, + "type": "eq" + }, { "id": "openoffice-pdf", "file": "pdfs/DiwanProfile.pdf", "md5": "55d0c6a1a6d26c9ec9dcecaa7a471e0e",