From b16c973d9d8acc95e3c14a075e1ea797fa94871b Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 31 Aug 2014 14:03:25 +0200 Subject: [PATCH] Fix Symbol fonts without font file but with Encoding dictionary (issue 5238) --- src/core/fonts.js | 7 +++++++ test/pdfs/.gitignore | 1 + test/pdfs/issue5238.pdf | Bin 0 -> 1152 bytes test/test_manifest.json | 7 +++++++ 4 files changed, 15 insertions(+) create mode 100644 test/pdfs/issue5238.pdf diff --git a/src/core/fonts.js b/src/core/fonts.js index ccba800cf..541159d63 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -2486,6 +2486,13 @@ var Font = (function FontClosure() { } this.toFontChar[charCode] = fontChar; } + for (charCode in properties.differences) { + fontChar = GlyphsUnicode[properties.differences[charCode]]; + if (!fontChar) { + continue; + } + this.toFontChar[charCode] = fontChar; + } } else if (/Dingbats/i.test(fontName)) { var dingbats = Encodings.ZapfDingbatsEncoding; for (charCode in dingbats) { diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 7a0ac0709..2ac3d956c 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -61,6 +61,7 @@ !issue4668.pdf !issue5039.pdf !issue5070.pdf +!issue5238.pdf !issue5244.pdf !gradientfill.pdf !bug903856.pdf diff --git a/test/pdfs/issue5238.pdf b/test/pdfs/issue5238.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a4ac44b22eb0a6ed333e75acdef4038ccc946dc7 GIT binary patch literal 1152 zcmZ`&T}V?=9M4=jjz*af_D~+vp=NsT-Q1iXS?M;4G^frNKcYK#wq4!s)w?_Vi2Pzk zB@~90f%Vo)K`I1-L>f^(1ZL)wn5aR5Nl8TzVs*~dUB;-xg>%mDp8v=B{eDMdHCZy5 ztQ??O`S|udU?2?zdjkXo1%R@(H6ciu`Fg>@@h(7_IHwbdh_6RJSi?Zdfm|ZOC%k@0 zHF^9#FUR|RkSg;c7YixLjU+sYtb?m(J&;1peln4Rb)c{iAl@NY(uS6_a2^SXkg|AK z37HVCi~v=Fc$egcT7!|q`6LmsUU24`t^b4&pkuGJbo5R=&I<$6)YEl$M%_d|A;1`L*WD8mZ9I?G(pn+5+>G6k4^Ab+ygE=y~V^-2ZXagifX`qPpAvqyc z+2*wi9za$4?UHPAVs&y2p^E2-=^$~X!W9Vu%0qzUk;r`nElgTas_eK`mrMHCF>8?x zFoZ;CGXcuN$SWsEi`X5h+7lJ6PKUMzV77sO=-4VEC!nDb(8_=YyPN-lE=9vu0 zD;T50vV~#UIoK3om|lxj55o*JrY#K1!4<o&VxiCi&Y^A5+n}96jpNW W2=_0O!HSZ6p