freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] cmap4 validation test problems


From: David Turner
Subject: Re: [Devel] cmap4 validation test problems
Date: Tue, 30 Apr 2002 00:16:55 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc1) Gecko/20020417

Hi Werner,

Werner LEMBERG wrote:
David, please note that the validation tests for cmap format 4 (in
ttcmap0.c) are too strict for many CJK fonts.  Most notably, these
two tests often fail:

    ...

    ends      = table   + 14;
    starts    = table   + 16 + num_segs * 2;
    deltas    = starts  + num_segs * 2;
    offsets   = deltas  + num_segs * 2;
    glyph_ids = offsets + num_segs * 2;

    if ( glyph_ids >= table + length )
      FT_INVALID_TOO_SHORT;                             <<<<<<

Hmmm.. it seems this test is too strict. It should
read:

      if ( glyph_ids > table + length )
        FT_INVALID_TOO_SHORT;

instead.


     ...

     for ( n = 0; n < num_segs; n++ )
      {
        p = starts + n * 2;
        start = TT_PEEK_USHORT( p );
        p = ends + n * 2;
        end = TT_PEEK_USHORT( p );
        p = deltas + n * 2;
        delta = TT_PEEK_SHORT( p );
        p = offsets + n * 2;
        offset = TT_PEEK_USHORT( p );

        if ( start > end )
          FT_INVALID_DATA;

        if ( n > 0 && start <= last )
          FT_INVALID_DATA;                              <<<<<<

Hummm.. if "start <= last", then the ranges defined in
the charmap are simply overlapping, which seems to be
quite an important bug within the font..

I'll try to have a look at the Chinse Arphic fonts
and see how their charmaps are organized..

I'll commit all changes to the CVS soon..

Thanks,

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





reply via email to

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