1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #2628 from mduan/issue2128

Add support for GBK-EUC-H encoding for cid fonts
This commit is contained in:
Yury Delendik 2013-01-30 09:44:24 -08:00
commit 8c78268a12
3 changed files with 17 additions and 1 deletions

View file

@ -410,7 +410,8 @@ var CMapConverterList = {
'90ms-RKSJ-H': sjisToUnicode,
'90ms-RKSJ-V': sjisToUnicode,
'90msp-RKSJ-H': sjisToUnicode,
'90msp-RKSJ-V': sjisToUnicode
'90msp-RKSJ-V': sjisToUnicode,
'GBK-EUC-H': gbkToUnicode
};
// CMaps using Hankaku (Halfwidth) Latin glyphs instead of proportional one.
@ -428,6 +429,8 @@ var HalfwidthCMaps = {
var decodeBytes;
if (typeof TextDecoder !== 'undefined') {
// The encodings supported by TextDecoder can be found at:
// http://encoding.spec.whatwg.org/#concept-encoding-get
decodeBytes = function(bytes, encoding) {
return new TextDecoder(encoding).decode(bytes);
};
@ -457,6 +460,10 @@ function sjisToUnicode(str) {
return decodeBytes(stringToBytes(str), 'shift_jis');
}
function gbkToUnicode(str) {
return decodeBytes(stringToBytes(str), 'gbk');
}
// 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.