pdf-association / pdf-issues

Industry-based resolutions for issues and errata reported against any PDF-related specification
https://pdf-issues.pdfa.org/
64 stars 2 forks source link

Can CFF fonts which use CIDFont operators in their Top DICT be simple PDF fonts? #473

Open seehuhn opened 1 week ago

seehuhn commented 1 week ago

Table 124 (Embedded font organisation for various font types) in the PDF-2.0 spec lists the cases when an OpenType font which uses CFF data can be embedded as a font program for a PDF font. The cases listed (in the FontFile3/OpenType row) are

A CIDFontType0 CIDFont dictionary, if the embedded font program contains a "CFF " [...] table with a Top DICT that uses CIDFont operators (this is equivalent to subtype CIDFontType0C).

and

A Type1 font dictionary or CIDFontType0 CIDFont dictionary, if the embedded font program contains a "CFF " table without CIDFont operators.

This list includes only three out of the four possible combinations of simple/composite and presence/absence of CIDFont operators. It does not allow fonts with a "CFF " table where a Top DICT that uses CIDFont operators is present in Type1 font dictionaries.

In contrast, the rules for directly embedding the CFF font data without the OpenType wrapper have no such restrictions: The FontFile3/Type1C row simply states that the following font type can be embedded:

Type 1–equivalent font program represented in the Compact Font Format (CFF), as described in Adobe Technical Note #5176 [...]. This entry may appear in the font descriptor for a Type1 or MMType1 font dictionary.

Technical note #5176 includes CID-keyed fonts, so CFF fonts with a Top DICT that uses CIDFont operators seem to be allowed here. (This is, unless additional restrictions hide in the term "type 1-equivalent"; I could not find a definition of this term.)

This seems to be an odd contradiction.

If CFF fonts with a Top DICT that uses CIDFont operators are in fact allowed for Type1 font dictionaries, my suggestion would be to add a note in the OpenType section, to explain that the restriction there can be worked around by directly embedding the contents of the "CFF " table as described in row FontFile3/Type1C.

On the other hand, if such fonts are not allowed in a Type1 font dict, this should be stated in the FontFile3/Type1C row of the table.

seehuhn commented 1 week ago

Thinking this through some more: I believe that CFF fonts which use CIDFont operators do not include glyph names, so these cannot possibly work for simple fonts. If this is true, my suggestion would be to just add the following sentence to the existing text in the FontFile3/Type1C row of the table:

Only CFF font programs without CIDFont operators can be used here.

Maybe this is also what "Type 1-equivalent" is attempting to mean?