mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
lib/font/embedded: Don't put '@' in font tag
Otherwise Adobe Illustrator says "This document uses fonts that are currently not available on your computer".
This commit is contained in:
parent
393734cf18
commit
63972499c0
@ -152,9 +152,9 @@ class EmbeddedFont extends PDFFont {
|
||||
flags |= 1 << 6;
|
||||
}
|
||||
|
||||
// generate a tag (6 uppercase letters. 16 is the char code offset from '1' to 'A'. 74 will map to 'Z')
|
||||
// generate a tag (6 uppercase letters. 17 is the char code offset from '0' to 'A'. 73 will map to 'Z')
|
||||
const tag = [1, 2, 3, 4, 5, 6]
|
||||
.map(i => String.fromCharCode((this.id.charCodeAt(i) || 74) + 16))
|
||||
.map(i => String.fromCharCode((this.id.charCodeAt(i) || 73) + 17))
|
||||
.join('');
|
||||
const name = tag + '+' + this.font.postscriptName;
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ describe('EmbeddedFont', () => {
|
||||
font.dictionary = dictionary;
|
||||
font.embed();
|
||||
|
||||
expect(dictionary.data.BaseFont).toBe('A@IIZZ+Roboto-Regular');
|
||||
expect(dictionary.data.BaseFont).toBe('BAJJZZ+Roboto-Regular');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user