Fix a problem about Japanese PDFs without embedded fonts
This commit is contained in:
parent
d111003cdb
commit
0980b4c322
@ -791,6 +791,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cidEncoding = baseDict.get('Encoding');
|
||||||
|
if (isName(cidEncoding))
|
||||||
|
properties.cidEncoding = cidEncoding.name;
|
||||||
|
|
||||||
var cidToGidMap = dict.get('CIDToGIDMap');
|
var cidToGidMap = dict.get('CIDToGIDMap');
|
||||||
if (isStream(cidToGidMap))
|
if (isStream(cidToGidMap))
|
||||||
properties.cidToGidMap = this.readCidToGidMap(cidToGidMap);
|
properties.cidToGidMap = this.readCidToGidMap(cidToGidMap);
|
||||||
|
13
src/fonts.js
13
src/fonts.js
@ -4126,6 +4126,15 @@ var Font = (function FontClosure() {
|
|||||||
} else
|
} else
|
||||||
cid++;
|
cid++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cidEncoding = properties.cidEncoding;
|
||||||
|
if (cidEncoding && cidEncoding.indexOf('Uni') === 0) {
|
||||||
|
// input is already Unicode for Uni* CMap encodings.
|
||||||
|
// However, Unicode-to-CID conversion is needed
|
||||||
|
// regardless of the CMap encoding. So we can't reset
|
||||||
|
// unicodeToCID.
|
||||||
|
this.cidToUnicode = [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
bindDOM: function Font_bindDOM() {
|
bindDOM: function Font_bindDOM() {
|
||||||
@ -4205,16 +4214,12 @@ var Font = (function FontClosure() {
|
|||||||
case 'CIDFontType0':
|
case 'CIDFontType0':
|
||||||
if (this.noUnicodeAdaptation) {
|
if (this.noUnicodeAdaptation) {
|
||||||
width = this.widths[this.unicodeToCID[charcode] || charcode];
|
width = this.widths[this.unicodeToCID[charcode] || charcode];
|
||||||
fontCharCode = mapPrivateUseChars(charcode);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
fontCharCode = this.toFontChar[charcode] || charcode;
|
fontCharCode = this.toFontChar[charcode] || charcode;
|
||||||
break;
|
break;
|
||||||
case 'CIDFontType2':
|
case 'CIDFontType2':
|
||||||
if (this.noUnicodeAdaptation) {
|
if (this.noUnicodeAdaptation) {
|
||||||
width = this.widths[this.unicodeToCID[charcode] || charcode];
|
width = this.widths[this.unicodeToCID[charcode] || charcode];
|
||||||
fontCharCode = mapPrivateUseChars(charcode);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
fontCharCode = this.toFontChar[charcode] || charcode;
|
fontCharCode = this.toFontChar[charcode] || charcode;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user