mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Merge pull request #1019 from padraiggalvin/define-font-mapping
Explicitly define default value for CIDToGIDMap
This commit is contained in:
commit
1228c259bd
@ -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();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user