pdf-lib icon indicating copy to clipboard operation
pdf-lib copied to clipboard

how can i use ttc font

Open qlynick opened this issue 2 years ago • 3 comments

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

qlynick avatar Apr 06 '22 13:04 qlynick

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.

joewestcott avatar Apr 10 '22 14:04 joewestcott

Hi @qlynick,

how did you initialize fontkit, can you share the code? thanks

madara3 avatar May 29 '23 01:05 madara3

Hi @qlynick,

how did you initialize fontkit, can you share the code? thanks I've given up 😂

qlynick avatar Sep 20 '23 01:09 qlynick