I wouldn’t call such a font (just `CFF ` table in an SFNT wrapper) an OpenType font (nor a TrueType font, nor an ISO OFF font). But the SFNT wrapper can host various sorts of tables, including many that aren’t part of the OpenType or ISO spec (like the `typ1` table used years ago by Apple). I think all kinds of table assortments can be put in an SFNT-based font resource, and there’s nothing invalid about such a resources — except that that resource isn’t a TT or OT or OFF font.
The question is whether FreeType wants to gracefully deal with SFNT-based font resources that aren’t TT or OT or OFF fonts. On Wed, Jun 5, 2024 at 12:36 AM Derek B. Noonburg <der...@glyphandcog.com> wrote: > 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 > > -- Adam Twardoch (to contact directly, remove "list." from e-mail address)