-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fonts with different font-weights #181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I like this approach, because it remains compatible with jsPDF@<2.3.0. However, I think we still should implement it differently: we should pass font style and font weight as separate arguments to setFont
. This way, we let jsPDF do the heavy lifting of combining them (which is more of an implementation detail, anyway). It would also be more futureproof, in case jsPDF improves the algorithm that matches a combination of font style and font weight with the available fonts.
In order to remain compatible with jsPDF@<2.3.0 we could switch between the old and new code paths depending on the jsPDF.version
property.
Hey @HackbrettXXX Thanks for review |
Ah, good catch! Unfortunately, I don't have a better idea for 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. |
- update complete-organization-chart-new to use a basic font
I've added some changes: the function for combining fonts was actually not correct in jsPDF. I've fixed it there (parallax/jsPDF#3217). The fix will be released with [email protected]. I've added a version switch to svg2pdf, so it will work with both jsPDF versions. The tests will fail until we update to [email protected]. We can do so, once it's released. |
@HackbrettXXX great job! Do you know when it will release? |
Hopefully soon ;) |
- only do special combine behavior for jsPDF 2.3.x - update references
Based on: parallax/jsPDF#3036
Now users can use any combination of font-weight and font-style