Skip to content
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

Font embedded setting may not work #550

Open
takotakot opened this issue May 24, 2021 · 3 comments
Open

Font embedded setting may not work #550

takotakot opened this issue May 24, 2021 · 3 comments
Labels

Comments

@takotakot
Copy link

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

  1. Copy https://github.com/LibrePDF/OpenPDF/wiki/Multi-byte-character-language-support-with-TTF-fonts
  2. Change font file to Jaldi-Regular.ttf, name to Jaldi-Regular
  3. Try embedded value both true and false

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
@takotakot takotakot added the bug label May 24, 2021
@asturio
Copy link
Member

asturio commented May 25, 2021

Pull requests are welcome.

@ObsisMc
Copy link

ObsisMc commented Mar 10, 2022

@asturio Hi, if no one takes it, I want to try it.

@ObsisMc
Copy link

ObsisMc commented Mar 14, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants