OpenPDF
OpenPDF copied to clipboard
Font embedded setting may not work
Describe the bug
Font embedded
config may not work.
I tried: https://github.com/LibrePDF/OpenPDF/wiki/Multi-byte-character-language-support-with-TTF-fonts with Jaldi-Regular.ttf in https://github.com/LibrePDF/OpenPDF/tree/master/openpdf/src/test/resources/fonts/jaldi .
To Reproduce Code to reproduce the issue
- Copy https://github.com/LibrePDF/OpenPDF/wiki/Multi-byte-character-language-support-with-TTF-fonts
- Change font file to Jaldi-Regular.ttf, name to Jaldi-Regular
- Try
embedded
value bothtrue
andfalse
Both generates 6508 byte HelloWorld.pdf .
Expected behavior PDF size changes.
System (please complete the following information):
- OS: Mac OS Big Sur
- openjdk 15.0.2
- library:
-
com.github.librepdf:openpdf:1.3.26
-
org.apache.xmlgraphics:fop:2.3
-
org.apache.xmlgraphics:xmlgraphics-commons:2.3
-
- Used Font: Jaldi-Regular
Pull requests are welcome.
@asturio Hi, if no one takes it, I want to try it.
@takotakot
you only replace font name in following code in https://github.com/LibrePDF/OpenPDF/wiki/Multi-byte-character-language-support-with-TTF-fonts, but "Identity-H"
will force embedded
to be true.
document.add(new Chunk( "नमस्ते", FontFactory.getFont("nirmala ui", "Identity-H",false,10,0,null)));
I don't know whether it is a wrong usage and I think @codecracker2014 can give us a help since maybe the feature is done by him according to #297.