[ 
https://issues.apache.org/jira/browse/PDFBOX-5071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thiago T updated PDFBOX-5071:
-----------------------------
    Description: 
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 glyphs 
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 I couldnt find a way to make it work with that font without 
creating a unnecessary large file

  was:
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 


> 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
>            Priority: Major
>         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 
> glyphs 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 I couldnt find a way to make it work with that font without 
> creating a unnecessary large file



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

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

Reply via email to