You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Thiago T (Jira)" <ji...@apache.org> on 2021/01/06 04:23:01 UTC

[jira] [Created] (PDFBOX-5071) OFT font cannot be embeded as subset

Thiago T created PDFBOX-5071:
--------------------------------

             Summary: OFT font cannot be embeded as subset
                 Key: PDFBOX-5071
                 URL: https://issues.apache.org/jira/browse/PDFBOX-5071
             Project: PDFBox
          Issue Type: Bug
          Components: FontBox
    Affects Versions: 2.0.19
         Environment: Mac OS Mojave
Java 1.8.151
PDFBox 2.0.19
            Reporter: Thiago T
         Attachments: SamplePDFService.java

When trying to generate an PDF with a OTF font (NotoSans), it doesnt allow to embed the subset.

Font location: 

[https://github.com/googlefonts/noto-cjk/blob/master/NotoSansCJKsc-Regular.otf]

 

 
{code:java}
OTFParser otfParser = new OTFParser();
OpenTypeFont otf = otfParser.parse(new File(fontPath));
return PDType0Font.load(doc, otf, false); //using true throws an exception.
{code}
 

If you set it to false it generates a huge file (14mb), even if just two gliphs are being selected.

The code attached demonstrates the problem.

If something is not correctly being used with this OTF file, please add a comment, as 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org