Whether I use this:

PdfDocument::CreateFontSubset("Arial", false, false);

Or this:

PdfDocument::CreateFont("Arial", false, false, false,
PdfEncodingFactory::GlobalWinAnsiEncodingInstance(),
PdfFontCache::eFontCreationFlags_Type1Subsetting);

It produces invalid pdf. Acrobat says "The font 'AAAAAA+ArialMT' contains
bad /Widths." and indeed it does not have widths:

19 0
obj<</Type/Font/BaseFont/AAAAAA+ArialMT/Encoding/WinAnsiEncoding/FontDescriptor
20 0 R/Subtype/TrueType>>

As non-subset fonts normally have (without
eFontCreationFlags_Type1Subsetting flag):

19 0 obj<</Type/Font/BaseFont/ArialMT/Encoding/WinAnsiEncoding/FirstChar
0/FontDescriptor 21 0 R/LastChar 255/Subtype/TrueType/Widths 20 0 R>>

Podofo itself cannot open such pdf, it throws here:

PODOFO_RAISE_ERROR_INFO( ePdfError_NoObject, "Font object defines neither
Widths, nor MissingWidth values!" );

This is really unfortunate because pdf with just subset of font could be
much smaller when I want to add just short text into it (or can be smaller
also with long text because how often can be found pdf which contains all
characters that font supports?).
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to