You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm observing something similiar to what #244 described: I'm registering a bunch of TTF files (Roboto) in different styles from the class path and trying to use these. However, OpenPDF seems to choose the regular (non-styled) font file and apply all necessary styles to it instead of using the styled version in the first place.
To Reproduce
Put the Roboto files (regular, italic, bold, bold-italic; downloadable from Google Fonts) onto the classpath (e.g., the resources folder when using maven) and register them like so:
This will lead to all files being read. Using them like new Paragraph ("text", ROBOTO_BOLD_ITALIC); will (apparently) not use the file previously read, but rather the regular one and OpenPDF will apply all given styles to that one. This is judging by the looks of the outcome, it looks just like the PDF displayed in #244.
Curiously, if I don't specify styles at all in FontFactory.getFont, then OpenPDF will only use ROBOTO_REGULAR whenever ROBOTO_ITALIC or ROBOTO_BOLD_ITALIC should have been used. ROBOTO_BOLD works as expected though.
Expected behavior
Italic and Bold-Italic should work as expected, using the correct file supplied for them.
Screenshots
This is produced by OpenPDF:
This is as displayed in-browser on Google Fonts:
This is as displayed in LibreOffice:
Obviously, OpenPDF's output looks just wrong: Notice the stroke weight and inclination angle.
System
OS: Linux (OpenSuSE Tumbleweed)
Used font: Roboto
OpenPDF version: 2.0.1 (cannot upgrade due to this issue)
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm observing something similiar to what #244 described: I'm registering a bunch of TTF files (Roboto) in different styles from the class path and trying to use these. However, OpenPDF seems to choose the regular (non-styled) font file and apply all necessary styles to it instead of using the styled version in the first place.
To Reproduce
Put the Roboto files (regular, italic, bold, bold-italic; downloadable from Google Fonts) onto the classpath (e.g., the
resources
folder when using maven) and register them like so:This will lead to all files being read. Using them like
new Paragraph ("text", ROBOTO_BOLD_ITALIC);
will (apparently) not use the file previously read, but rather the regular one and OpenPDF will apply all given styles to that one. This is judging by the looks of the outcome, it looks just like the PDF displayed in #244.Curiously, if I don't specify styles at all in
FontFactory.getFont
, then OpenPDF will only useROBOTO_REGULAR
wheneverROBOTO_ITALIC
orROBOTO_BOLD_ITALIC
should have been used.ROBOTO_BOLD
works as expected though.Expected behavior
Italic and Bold-Italic should work as expected, using the correct file supplied for them.
Screenshots
This is produced by OpenPDF:
This is as displayed in-browser on Google Fonts:
This is as displayed in LibreOffice:
Obviously, OpenPDF's output looks just wrong: Notice the stroke weight and inclination angle.
System
The text was updated successfully, but these errors were encountered: