freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

permissiveness in FreeType for CFF fonts


From: Claudiu Milea
Subject: permissiveness in FreeType for CFF fonts
Date: Tue, 21 Mar 2023 22:00:44 +0000

Hi,

 

We encountered a few (potentially not fully compliant with the specification) CFF fonts (i.e. CIDFontType0) that have enough information to be rendered, but FreeType throws an exception due to not having both the `head` and the `cmap` tables.

I was wondering if the second `goto Exit;` in the following code could be changed to just logging a warning? With this change fonts that are missing the `head` table and don’t have a `cmap` could still be rendered.

 

In src/cff/cffobjs.c :

 

     /* now, the font can be either an OpenType/CFF font, or an SVG CEF */

      /* font; in the latter case it doesn't have a `head' table         */

      error = face->goto_table( face, TTAG_head, stream, 0 );

      if ( !error )

      {

        pure_cff = 0;

 

        /* load font directory */

        error = sfnt->load_face( stream, face, face_index,

                                 num_params, params );

        if ( error )

          goto Exit;

      }

      else

      {

       /* load the `cmap' table explicitly */

        error = sfnt->load_cmap( face, stream );

        if ( error )

          goto Exit;

      }

 

Thank you,

Andrei


reply via email to

[Prev in Thread] Current Thread [Next in Thread]