Merge pull request #2562 from vyv03354/master

Fix a problem about Japanese PDFs without embedded fonts
This commit is contained in:
Yury Delendik 2013-01-14 14:07:36 -08:00
commit 5631e5ba54
5 changed files with 20 additions and 4 deletions

View File

@ -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');
if (isStream(cidToGidMap))
properties.cidToGidMap = this.readCidToGidMap(cidToGidMap);

View File

@ -4126,6 +4126,15 @@ var Font = (function FontClosure() {
} else
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() {
@ -4205,16 +4214,12 @@ var Font = (function FontClosure() {
case 'CIDFontType0':
if (this.noUnicodeAdaptation) {
width = this.widths[this.unicodeToCID[charcode] || charcode];
fontCharCode = mapPrivateUseChars(charcode);
break;
}
fontCharCode = this.toFontChar[charcode] || charcode;
break;
case 'CIDFontType2':
if (this.noUnicodeAdaptation) {
width = this.widths[this.unicodeToCID[charcode] || charcode];
fontCharCode = mapPrivateUseChars(charcode);
break;
}
fontCharCode = this.toFontChar[charcode] || charcode;
break;

View File

@ -37,3 +37,4 @@
!basicapi.pdf
!mixedfonts.pdf
!shading_extend.pdf
!noembed-identity.pdf

Binary file not shown.

View File

@ -795,5 +795,11 @@
"md5": "9f11e815b485f7f0e1fa5c116c636cf9",
"rounds": 1,
"type": "eq"
},
{ "id": "noembed-identity",
"file": "pdfs/noembed-identity.pdf",
"md5": "05d3803b6c22451e18cb60d8d8c75c0c",
"rounds": 1,
"type": "eq"
}
]