freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Num glyphs in cff fonts


From: David Turner
Subject: Re: [Devel] Num glyphs in cff fonts
Date: Wed, 23 Apr 2003 16:22:26 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

Hello Martin,

Martin Muskens wrote:
Hi,

In the file "cffobjs.c" in the routine "cff_face_init" this happens:

     root->num_glyphs = cff->num_glyphs;

after that, the root->num_glyphs get adapted, but the cff->num_glyphs are left unchanged:

       if ( dict->cid_registry )
          root->num_glyphs = dict->cid_count;
        else
          root->num_glyphs = cff->charstrings_index.count;


in the file "cffcmap.c" in the routine "cff_cmap_unicode_init" there is a line

    count = (FT_UInt)face->root.num_glyphs;

after that, this loop is done:

      for ( n = 0; n < count; n++ )
      {
        FT_UInt      sid   = charset->sids[n]; etc...


The problem is, that the sids array has been constructed with a cff->num_glyphs length, which is not always as large as "count". It results in a crash.

How to fix this problem?


According to the specification, CID-keyed CFF fonts do not use SIDs
but CIDs that are relative to an external CMap file.

Until FreeType 2 is able to read and attach CMap files to FT_Faces,
I think that the solution is to prevent a Unicode charmap from being
built when the font is initialized. I'll try to provide a patch.

Thanks,

- David Turner
- The FreeType Project  (www.freetype.org)


--
This message and any attachments (the "message") is intended solely for the
addressees and is confidential. If you receive this message in error, please
delete it and immediately notify the sender.
Any use not in accordance with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.
The E-Mail transmission can not guarantee the integrity of this message.
CANAL+TECHNOLOGIES will not therefore be liable for the message if modified.





reply via email to

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