On Fri, 31 May 2024 22:57:30 -0400
Alexei Podtelezhnikov <apodt...@gmail.com> wrote:

> Derek,
> 
> On Fri, May 31, 2024 at 2:23 PM Derek B. Noonburg
> <der...@glyphandcog.com> wrote:
> > For what it's worth, I've encountered the same problem in a few PDF
> > files. In all the cases I've seen, the OpenType file contains just
> > the 'CFF ' table. My code checks for a missing 'head' table, and in
> > that case it extracts the CFF blob and handles it as a CFF (not
> > OpenType) font.
> >
> > I haven't run into a font that has 'head' and 'CFF ', but not
> > 'cmap'. If that's what you have, it would be a problem for my code,
> > too.  
> 
> Please leave a comment at
> https://gitlab.freedesktop.org/freetype/freetype/-/issues/1278
> If you can attach an example PDF file with such font. It'd be even
> better if you proposed an MR.

I only have a couple example files, and they were both received from
customers under NDA, unfortunately. I can extract a font if you're
interested, but I don't think that will really prove anything to you.

It looks like some software (my sample files are ~10 years old) decided
to wrap a CFF font into an sfnt structure, with the single 'CFF '
table, and call it an OpenType font. I see a lot of dodgy fonts in PDF
files; I imagine you have similar stories as a FreeType maintainer...

For the record, I don't consider this particular case a FreeType bug,
but rather a bug in the PDF file. I added the workaround in my Xpdf code
long ago.

- Derek

Reply via email to