mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
tests/font.spec.js: Add EmbeddedFont.embed() test
This commit is contained in:
parent
923c495022
commit
393734cf18
@ -33,4 +33,23 @@ describe('EmbeddedFont', () => {
|
||||
|
||||
expect(runSpy).toBeCalledTimes(4);
|
||||
});
|
||||
|
||||
describe('emebed', () => {
|
||||
test('sets BaseName based on font id and postscript name', () => {
|
||||
const document = new PDFDocument();
|
||||
const font = PDFFontFactory.open(
|
||||
document,
|
||||
'tests/fonts/Roboto-Regular.ttf',
|
||||
undefined,
|
||||
'F1099'
|
||||
);
|
||||
const dictionary = {
|
||||
end: () => {},
|
||||
};
|
||||
font.dictionary = dictionary;
|
||||
font.embed();
|
||||
|
||||
expect(dictionary.data.BaseFont).toBe('A@IIZZ+Roboto-Regular');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user