From a2637823db921902c95ba09a254e35375cd1664a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzuki=2C=20Toshiya=20=28=E9=88=B4=E6=9C=A8=E4=BF=8A?= =?UTF-8?q?=E5=93=89=29?= Date: Mon, 18 Aug 2008 04:44:56 +0000 Subject: [PATCH] * src/sfnt/ttcmap.c: Fix for empty sub-headers in Dynalab fonts --- ChangeLog | 8 ++++++++ src/sfnt/ttcmap.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3313ab22a..c72ebac5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-18 suzuki toshiya + + * src/sfnt/ttcmap.c (tt_cmap2_validate): Skip the validation of + sub-header when its code_count is 0. Many Japanese Dynalab fonts + include such empty sub-header (code_count == 0, first_code == 0 + delta == 0, but offset != 0 ) as the second sub-header in SJIS + cmap. + 2008-08-04 Werner Lemberg * src/type1/t1tokens.h: Handle `ForceBold' keyword. This fixes diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 21387b509..1b5cf69c2 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -328,6 +328,10 @@ delta = TT_NEXT_SHORT( p ); offset = TT_NEXT_USHORT( p ); + /* many Dynalab fonts have empty sub-header */ + if ( 0 == code_count ) + continue; + /* check range within 0..255 */ if ( valid->level >= FT_VALIDATE_PARANOID ) {