diff --git a/lib/font/embedded.js b/lib/font/embedded.js index 7b9a97f..fe26154 100644 --- a/lib/font/embedded.js +++ b/lib/font/embedded.js @@ -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; diff --git a/tests/unit/font.spec.js b/tests/unit/font.spec.js index f8cc94d..6724155 100644 --- a/tests/unit/font.spec.js +++ b/tests/unit/font.spec.js @@ -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'); }); }); });