freetype-devel
[Top][All Lists]
Advanced

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

[Devel] cmap4 validation test problems


From: Werner LEMBERG
Subject: [Devel] cmap4 validation test problems
Date: Sun, 28 Apr 2002 12:40:00 +0200 (CEST)

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;                             <<<<<<



     ...

     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;                              <<<<<<


In particular, the free Chinese Arphic fonts (bsmi00lp and friends)
don't pass the validation.  Using e.g.

  ftview -e unic 50 bsmi00lp.ttf

fails.

Can you improve that?


    Werner



reply via email to

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