-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Bug Report
Description of the problem
PDFKit currently requires filesystem access to load default fonts during document initialization, even when later using only embedded fonts via registerFont(). This breaks in environments where system font paths are unavailable, e.g. compiled portable Deno executable in my case.
Code sample
// Fails - tries to load system fonts during initialization
const doc1 = new PDFDocument();
// Also fails - undefined still triggers default font loading
const doc2 = new PDFDocument({ font: undefined });My current workaround is to initialize document with empty string to bypass default font loading, then register embedded fonts:
const doc = new PDFDocument({ font: "" }); // Skip system font loading
doc.registerFont('Courier', embeddedCourierData);
doc.font('Courier');But would appreciate a cleaner solution.
Your environment
- pdfkit version: 0.17.0
NodeDeno version: 2.5.0- Browser version (if applicable): -
- Operating System: Arch Linux
tomfrew and monolithed
Metadata
Metadata
Assignees
Labels
No labels