freetype-devel
[Top][All Lists]
Advanced

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

[Devel] CID font bug


From: Derek B. Noonburg
Subject: [Devel] CID font bug
Date: Wed, 21 Jul 2004 17:45:41 -0700 (PDT)

I think the code that loads the charset for CID CFF fonts is wrong.
Specifically you "invert" (generate a CID -> GID mapping) only if the
charstring count is different from the CID count.  But it's still legal
for a CID font to specify a different CID -> GID mapping in this case,
so you need to generate that mapping for all CID fonts.  (I ran into the
problem with a font subset embedded in a PDF file.)

Here's a patch (against FT 2.1.9).

- Derek


*** cffload.c.orig      Wed Jul 21 17:39:15 2004
--- cffload.c   Wed Jul 21 17:39:25 2004
***************
*** 2242,2249 ****
        FT_Bool  invert;
  
  
!       invert = dict->cid_registry != 0xFFFFU &&
!                font->charstrings_index.count != dict->cid_count;
        error = cff_charset_load( &font->charset, font->num_glyphs, stream,
                                  base_offset, dict->charset_offset, invert );
        if ( error )
--- 2242,2248 ----
        FT_Bool  invert;
  
  
!       invert = dict->cid_registry != 0xFFFFU;
        error = cff_charset_load( &font->charset, font->num_glyphs, stream,
                                  base_offset, dict->charset_offset, invert );
        if ( error )




reply via email to

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