Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
- Can no longer set page font to be a falsy value
  • Loading branch information
hollandjake committed Dec 26, 2024
1 parent f19a3e8 commit 2ae9b06
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { normalizeSides } from './utils';
/**
* @type {SideDefinition<Size>}
*/
const DEFAULT_MARGINS = '1in';
const DEFAULT_MARGINS = {
top: 72,
left: 72,
bottom: 72,
right: 72,
};

const SIZES = {
'4A0': [4767.87, 6740.79],
Expand Down Expand Up @@ -78,8 +83,8 @@ class PDFPage {

this.content = this.document.ref();

if (options.font !== undefined) document.font(options.font, options.fontFamily);
if (options.fontSize !== undefined) document.fontSize(options.fontSize);
if (options.font) document.font(options.font, options.fontFamily);
if (options.fontSize) document.fontSize(options.fontSize);

// process margins
// Margin calculation must occur after font assignment to ensure any dynamic sizes are calculated correctly
Expand Down

0 comments on commit 2ae9b06

Please sign in to comment.