Hi Werner,

I asked around about the legality of extraction and sharing an embedded 
subsetted font in a PDF and I did not get a favorable response so I am sorry 
that I cannot help you in this regard. I can provide a standalone function to 
at-least demonstrate the workflow that exhibits this issue.


static void load_font_file()

{

    FT_Library ft_lib;

    FT_Init_FreeType( &ft_lib );

    FT_Face face;

    const char* file_path = "/Users/Subsetted_Times_Roman.txt";

    FT_Error err = FT_New_Face(ft_lib, file_path, 0, &face);

    err = FT_Load_Glyph(face, 13, FT_LOAD_DEFAULT);

}

err​ in the code above gets a value of 6 after loading the glyph with a CID of 
13 for the CID keyed CFF font.

Thanks,
Honnesh

From: Werner LEMBERG <[email protected]>
Date: Saturday, November 29, 2025 at 1:35 AM
To: Honnesh Ramachandra <[email protected]>, [email protected] 
<[email protected]>
Subject: Re: Non-zero CID mapped to GID 0 treated as error for CID keyed font

EXTERNAL: Use caution when clicking on links or opening attachments.


> During my evaluation of rendering difference in an
> internal/confidential PDF, I came across this situation in FreeType
> for a CID-keyed subsetted font where if a non-zero CID is mapped to
> a glyph ID of 0, this is considered an error.  Our in-house CFF
> parser does not consider this an error.  I am curious to know the
> rationale behind treating this as an erroneous situation, it this
> based on a CFF specification.  Here is a snapshot of the glyph
> arrangement for the font in question.

Thanks for the report.  While the PDF might be confidential, the
subsetted font in the PDF causing the problem is most certainly not.
So please extract this font and send it to the list (compressed) –
it's much easier to have something to debug.  To be honest, I no
longer remember why a zero index gets rejected :-)

You would also help us a lot by writing a small, stand-alone C program
(i.e., a small program running and emitting data on the console) that
exhibits the issue.


    Werner

Reply via email to