Hello,
I'm using Jasperreports and switched from itext to openpdf.
Unfortunately the bold fonts when exporting the report to pdf are too thick.
I've made a sample project to show you: https://github.com/razilein/openpdf-test
When switching between itext and openpdf you can see a huge difference between the bold and italic text.
On the left you can see the exported pdf with openpdf on the right with itext

Do you know a workaround or can you fix this please?
Hello,
I found the commit responsible for this behaviour:
https://github.com/LibrePDF/OpenPDF/commit/9cf326d21562a90ff86afa5632b5a652f2e2ebdd
There is Unit Test associated to this commit, that is great!
But even with this I can't figure out how to solve the issue.
Lets say, we want a font in bold for example "Courrier"
This is what I understand about this code:
So at the end we are creating a font with name "courrier-bold" and that will be rendered in Bold.
In the PDF we render the text as Courrier Bold Bold
See: #106 @noavarice
The problem here, is to be able to make a difference between:
This way we would be able to manipulate Courrier Font in Bold style through the API, and use courrier-bold in normal style at render time.
Do you agree?
@asturio I'd like your advice on this one, if you it's possible
Hi, sorry for the delay. Yes, I think your suggestion is the right way to go. As some fonts are present in the style you need, you should use that font (courrier-bold.ttf in normal style), instead of the normal font ("courrier.ttf" in bold style). The second option should only be used if the "bold" font is not present.
Tests and Merge requests welcome :-)
I've created the pullrequest #262
Most helpful comment
Hi, sorry for the delay. Yes, I think your suggestion is the right way to go. As some fonts are present in the style you need, you should use that font (courrier-bold.ttf in normal style), instead of the normal font ("courrier.ttf" in bold style). The second option should only be used if the "bold" font is not present.
Tests and Merge requests welcome :-)