freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/cff/cffobjs.c (cff_face_init): Be


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] * src/cff/cffobjs.c (cff_face_init): Better handling of Type0 fonts.
Date: Wed, 06 Nov 2024 05:35:29 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

  • 3f3e3de3
    by Honnesh Ramachandra at 2024-11-06T06:28:41+01:00
    * src/cff/cffobjs.c (cff_face_init): Better handling of Type0 fonts.
    
    This issue relates to the PDF specification and its usage of CFF-based
    embedded Type0 fonts.  For Type0 fonts containing CID-keyed descendant
    CFF-based fonts, the glyph index is the CID present in the content stream.
    As a result, there is no requirement for a 'cmap' table to be present in the
    font since the glyph indices are derived directly from the CIDs.  FreeType
    throws an error when it doesn’t find a 'cmap' table for such an Open Type
    font containing CFF outlines.  This commit relaxes this requirement for a
    'cmap' table for such fonts.
    

1 changed file:

Changes:

  • src/cff/cffobjs.c
    ... ... @@ -550,13 +550,13 @@
    550 550
             if ( error )
    
    551 551
               goto Exit;
    
    552 552
           }
    
    553
    -      else
    
    554
    -      {
    
    555
    -        /* load the `cmap' table explicitly */
    
    556
    -        error = sfnt->load_cmap( face, stream );
    
    557
    -        if ( error )
    
    558
    -          goto Exit;
    
    559
    -      }
    
    553
    +
    
    554
    +      /* load the `cmap' table explicitly */
    
    555
    +      error = sfnt->load_cmap( face, stream );
    
    556
    +
    
    557
    +      /* this may fail because CID-keyed fonts don't have a cmap */
    
    558
    +      if ( FT_ERR_NEQ( error, Table_Missing ) && FT_ERR_NEQ( error, Ok ) )
    
    559
    +        goto Exit;
    
    560 560
     
    
    561 561
           /* now load the CFF part of the file; */
    
    562 562
           /* give priority to CFF2              */
    


  • reply via email to

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