Merge pull request #1019 from padraiggalvin/define-font-mapping

Explicitly define default value for CIDToGIDMap
This commit is contained in:
Luiz Américo 2019-09-04 11:17:31 -03:00 committed by GitHub
commit 1228c259bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,9 +185,9 @@ class EmbeddedFont extends PDFFont {
descriptor.end();
const descendantFont = this.document.ref({
const descendantFontData = {
Type: 'Font',
Subtype: isCFF ? 'CIDFontType0' : 'CIDFontType2',
Subtype: 'CIDFontType0',
BaseFont: name,
CIDSystemInfo: {
Registry: new String('Adobe'),
@ -196,7 +196,14 @@ class EmbeddedFont extends PDFFont {
},
FontDescriptor: descriptor,
W: [0, this.widths]
});
};
if (!isCFF) {
descendantFontData.Subtype = 'CIDFontType2';
descendantFontData.CIDToGIDMap = 'Identity';
}
const descendantFont = this.document.ref(descendantFontData);
descendantFont.end();