Closed EugeneBalabai closed 2 years ago
Hey @HackbrettXXX
Thanks for review
yep, we can pass font-weight as separate arguments to setFont
and I will do it (a bit later). But what about findFirstAvailableFontFamily
? We still need to combine font style and font-weight with the same algorithm as jsPDF to get the correct fontFamily. Or do you have any ideas on how we can solve this?
Ah, good catch! Unfortunately, I don't have a better idea for findFirstAvailableFontFamily
. I guess, If we're forced to combine font style/weight manually anyway, we can just take your initial implementation.
Could you have a look at the failing tests? Seems like some test cases produce different results now. The new results are probably correct, though. Please update the reference files in that case.
I've added some changes: the function for combining fonts was actually not correct in jsPDF. I've fixed it there (https://github.com/MrRio/jsPDF/pull/3217). The fix will be released with jsPDF@2.4.0. I've added a version switch to svg2pdf, so it will work with both jsPDF versions. The tests will fail until we update to jsPDF@2.4.0. We can do so, once it's released.
@HackbrettXXX great job! Do you know when it will release?
Hopefully soon ;)
Based on: https://github.com/MrRio/jsPDF/pull/3036
Now users can use any combination of font-weight and font-style