Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedding CFF-based OpenType fonts via FontFile3CIDType0 #98

Closed
seehuhn opened this issue Aug 17, 2023 · 1 comment
Closed

embedding CFF-based OpenType fonts via FontFile3CIDType0 #98

seehuhn opened this issue Aug 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@seehuhn
Copy link

seehuhn commented Aug 17, 2023

When running the attached PDF file through TestGrammar, I get the error message

Error: wrong value for possible values: Subtype (FontFile3CIDType0) should be: name [CIDFontType0C] in PDF 1.7 and is name==OpenType

My reading of the PDF spec is, that OpenType is in fact allowed, and possibly even required here: The FontFile3 entry of Table 124 lists three possible values for Subtype, one of which is OpenType. This subtype, in turn, can be used in three different situations, one of which is described as

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).

This is the type of font embedded in the attached PDF file. I don't completely understand the meaning of the "is equivalent" clause cited above, but in my reading the table definitely allows, and possibly required use of the OpenType subtype for this font.

fonts09.pdf

For reference, here is a decoded version of the relevant dictionaries:

  • The Type 0 font dictionary (object 1):

    <<
    /Type /Font
    /Subtype /Type0
    /BaseFont /IPSVQA+Go-Regular-Seehuhn-4de0580189d4bfc2
    /DescendantFonts [3 0 R]
    ...
    >>
    
  • The CIDFont dictionary (object 3):

    <<
    /Type /Font
    /Subtype /CIDFontType0
    /BaseFont /IPSVQA+Go-Regular
    /FontDescriptor 4 0 R
    ...
    >>
    
  • The Font Descriptor (object 4):

    <<
    /Type /FontDescriptor
    /FontName /IPSVQA+Go-Regular
    /FontFile3 5 0 R
    ...
    >>
    
  • The embedded font stream dictionary (object 5):

    <<
    /Filter /FlateDecode
    /Length 1812
    /Subtype /OpenType
    >>
    
@petervwyatt petervwyatt added the bug Something isn't working label Aug 7, 2024
@petervwyatt petervwyatt added this to the PDF Data Model milestone Aug 7, 2024
@petervwyatt
Copy link
Member

petervwyatt commented Aug 7, 2024

Looks like we didn't turn the page... FontFile3 is split into 3 separate rows on pages which is unique in 32K: every other key is always a single row. Thus also a formatting error in 32K!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants