From ec27f770da4a3bf287560dfa325f21f3e54804bf Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Tue, 21 Aug 2012 10:22:37 +0000 Subject: support large truetype fonts git-svn-id: svn://tug.org/texlive/trunk@27482 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfmx/ChangeLog.TL | 5 +++++ Build/source/texk/dvipdfmx/src/tt_post.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/dvipdfmx/ChangeLog.TL b/Build/source/texk/dvipdfmx/ChangeLog.TL index caba3bc7a4b..91ed5c483b8 100644 --- a/Build/source/texk/dvipdfmx/ChangeLog.TL +++ b/Build/source/texk/dvipdfmx/ChangeLog.TL @@ -1,3 +1,8 @@ +2012-08-21 Akira Kakuto + + * tt_post.c (read_v2_post_names): support large truetype fonts + which are strictly speaking out of spec, idx > 32767. + 2012-08-21 keiichirou shikano * src/cff.c, src/cff.h. src/type1.c: fix type1 SEAC bug. diff --git a/Build/source/texk/dvipdfmx/src/tt_post.c b/Build/source/texk/dvipdfmx/src/tt_post.c index 418854e3861..98676350792 100644 --- a/Build/source/texk/dvipdfmx/src/tt_post.c +++ b/Build/source/texk/dvipdfmx/src/tt_post.c @@ -50,8 +50,20 @@ read_v2_post_names (struct tt_post_table *post, sfnt *sfont) idx = sfnt_get_ushort(sfont); if (idx >= 258) { if (idx > 32767) { - WARN("TrueTypes post table name index %u > 32767", idx); - idx = 0; + /* Although this is strictly speaking out of spec, it seems to work + and there are real-life fonts that use it. + We show a warning only once, instead of thousands of times */ + static char warning_issued = 0; + if (!warning_issued) { + WARN("TrueTypes post table name index %u > 32767", idx); + warning_issued = 1; + } + /* In a real-life large font, (x)dvipdfmx crashes if we use + nonvanishing idx in the case of idx > 32767. + If we set idx = 0, (x)dvipdfmx works fine for the font and + created pdf seems fine. The post table may not be important + in such a case */ + idx = 0; } post->count++; } -- cgit v1.2.3