From 27d114bd11727ca570e8798db0d81bab797a7465 Mon Sep 17 00:00:00 2001 From: "allstars.chh" Date: Thu, 28 Feb 2013 08:39:27 +0800 Subject: [PATCH 1/2] Add support for big5 encoding. --- src/fonts.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fonts.js b/src/fonts.js index 0e7424d17..78e6a8994 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -415,7 +415,9 @@ var CMapConverterList = { '90ms-RKSJ-V': sjisToUnicode, '90msp-RKSJ-H': sjisToUnicode, '90msp-RKSJ-V': sjisToUnicode, - 'GBK-EUC-H': gbkToUnicode + 'GBK-EUC-H': gbkToUnicode, + 'ETenms-B5-H': big5ToUnicode, + 'ETenms-B5-V': big5ToUnicode, }; // CMaps using Hankaku (Halfwidth) Latin glyphs instead of proportional one. @@ -468,6 +470,10 @@ function gbkToUnicode(str) { return decodeBytes(stringToBytes(str), 'gbk'); } +function big5ToUnicode(str) { + return decodeBytes(stringToBytes(str), 'big5'); +} + // Some characters, e.g. copyrightserif, mapped to the private use area and // might not be displayed using standard fonts. Mapping/hacking well-known chars // to the similar equivalents in the normal characters range. From d67b4ed53b1d1fc3965847d23ca8bf86c84d6469 Mon Sep 17 00:00:00 2001 From: "allstars.chh" Date: Thu, 28 Feb 2013 08:56:12 +0800 Subject: [PATCH 2/2] test for issue2829. --- test/pdfs/issue2829.pdf.link | 1 + test/test_manifest.json | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 test/pdfs/issue2829.pdf.link diff --git a/test/pdfs/issue2829.pdf.link b/test/pdfs/issue2829.pdf.link new file mode 100644 index 000000000..3f8327707 --- /dev/null +++ b/test/pdfs/issue2829.pdf.link @@ -0,0 +1 @@ +http://www.ym.edu.tw/bcial/property/IP/laws/iplaws01.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index a455b116c..1638bc3c3 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -934,5 +934,12 @@ "md5": "c7eca682d70a976dfc4b7e64d3e9f1ce", "rounds": 1, "type": "eq" + }, + { "id": "issue2829", + "file": "pdfs/issue2829.pdf", + "md5": "f32b28cf8792f6ccc470446bfbb38584", + "link": true, + "rounds": 1, + "type": "eq" } ]