pdf-lib
pdf-lib copied to clipboard
how can i use ttc font
What are you working on?
when i load ttc font. can not use it.
` var font_url = '/examples/pdf/font/AppleSDGothicNeo.ttc' const fontBytes = await fetch(font_url).then(res => res.arrayBuffer())
const pdfDoc = await PDFDocument.create(); pdfDoc.registerFontkit(fontkit) const customFont = await pdfDoc.embedFont(fontBytes, { subset: true }) `
can anybody help me?
Additional Notes
No response
Hi @qlynick,
Font subsetting is not well supported right now. See https://github.com/Hopding/pdf-lib/issues/494#issuecomment-695818400.
A fix for subsetting is here, which is waiting on feedback from @Hopding at the moment.
For now, you may need to avoid the {subset: true }
option.
Hi @qlynick,
how did you initialize fontkit, can you share the code? thanks
Hi @qlynick,
how did you initialize fontkit, can you share the code? thanks I've given up 😂