PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Create Font Subsets of PostScript OTF
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3628
Page 1 of 1

Author:  hickhack [ Wed Jul 19, 2017 1:18 pm ]
Post subject:  Create Font Subsets of PostScript OTF

When embedding CID fonts into a PDF, a subset of the font is created using the font's index to location (loca) table. Therefore, the PdfCIDFont class will check whether the loca field is null in PrepareForSave(). We are using an OpenType Font that contains PostScript outlines. Since these never contain a loca table, but a CFF table instead, PDFSharp will not create a subset and always embed the entire font into the PDF. This will result in documents with a 27MB file size (the documents only contain two images with two lines of captions; they are only 200-300KB large when using a TrueType font). How can I use the CFF information to create a subset for PostScript fonts?

Author:  Thomas Hoevel [ Wed Jul 19, 2017 1:37 pm ]
Post subject:  Re: Create Font Subsets of PostScript OTF

Hi!
hickhack wrote:
How can I use the CFF information to create a subset for PostScript fonts?
Not my area of expertise.
My guess is that support for OpenType fonts in PDFsharp is basic and/or indirect. Maybe you have to take the PDFsharp source code and implement support for OTF subsets.
Or convert the font to TTF. Or obtain a TTF version of that font if available.

I assume that you cannot simply use a similar TTF for sake of corporate identity.

See also:
http://www.pdfsharp.net/wiki/PostScript_fonts.ashx

Author:  hickhack [ Wed Jul 19, 2017 1:58 pm ]
Post subject:  Re: Create Font Subsets of PostScript OTF

Actually, OpenType fonts that contain TrueType outlines work just fine. It's just the PostScript outlines that are fully embedded.
We are already working with the full source code, so extending it would be the option I am looking into. However, I don't know how to create the subset from the CFF table.

Quote:
Or convert the font to TTF. Or obtain a TTF version of that font if available.

We tried both of these options, even with TransType. So far without any luck.

Quote:
I assume that you cannot simply use a similar TTF for sake of corporate identity.

That is indeed the problem.

Author:  Thomas Hoevel [ Wed Jul 19, 2017 2:47 pm ]
Post subject:  Re: Create Font Subsets of PostScript OTF

Have you tried to create a PDF with ANSI fonts (turn Unicode support in PDFsharp or MigraDoc off)?

Author:  hickhack [ Wed Jul 19, 2017 3:16 pm ]
Post subject:  Re: Create Font Subsets of PostScript OTF

Sorry for asking, but how do I turn off Unicode support?
We are creating the PDF from a WPF application using the MigraDoc Document class.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/