mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Add support for GBK-EUC-H encoding for cid fonts
This commit is contained in:
parent
9af6e05456
commit
81399ee068
3 changed files with 17 additions and 1 deletions
|
@ -410,11 +410,14 @@ 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
|
||||
};
|
||||
|
||||
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);
|
||||
};
|
||||
|
@ -444,6 +447,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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue