[truetype] Recalculate the sfnt table checksum always.

* src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate
the sfnt table checksum even if non-zero value is writte in
the TrueType font header.  Some bad PDF generators write
wrong values.  For detail, see examples and benchmark tests
of the latency by recalculation:
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html
This commit is contained in:
suzuki toshiya 2011-05-01 00:47:43 +09:00
parent 1e89d15a27
commit 58cb359335
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,15 @@
2011-04-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
[truetype] Recalculate the sfnt table checksum always.
* src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate
the sfnt table checksum even if non-zero value is writte in
the TrueType font header. Some bad PDF generators write
wrong values. For detail, see examples and benchmark tests
of the latency by recalculation:
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html
http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html
2011-04-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp> 2011-04-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
[truetype] Register a set of tricky fonts, NEC FA family. [truetype] Register a set of tricky fonts, NEC FA family.

View File

@ -213,8 +213,10 @@
tt_get_sfnt_checksum( TT_Face face, tt_get_sfnt_checksum( TT_Face face,
FT_UShort i ) FT_UShort i )
{ {
#if 0 /* if we believe the written value, use following part. */
if ( face->dir_tables[i].CheckSum ) if ( face->dir_tables[i].CheckSum )
return face->dir_tables[i].CheckSum; return face->dir_tables[i].CheckSum;
#endif
if ( !face->goto_table ) if ( !face->goto_table )
return 0; return 0;