alafr / SVG-to-PDFKit

Insert SVG into a PDF document created with PDFKit
MIT License
397 stars 111 forks source link

Allow usage of font-weight attribute within fontCallback #176

Open mewtlu opened 1 year ago

mewtlu commented 1 year ago

This is a breaking change to the fontCallback method which allows the user to make use of the exact font-weight value of the element rather than just a boolean of whether it is a bold variant.

Font weights of 800 and 900 are now classified as 'bolder' rather than 'bold', so the fontCallback is passed a weight string of type: 'normal' | 'bold' | 'bolder'.