diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-01-10 14:06:19 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-01-10 14:06:19 +0000 |
commit | 4a436b90db469ffdab8ae4fea378e64ecf3f4b20 (patch) | |
tree | a7b9661620ed36e357df638b552cb920fc629871 /Build/source/texk/xdvipdfmx | |
parent | c742c565b82f2588cda3e544f90281254b569bc1 (diff) |
Change calculation of post->count for special fonts with unused index.
git-svn-id: svn://tug.org/texlive/trunk@28787 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvipdfmx')
-rw-r--r-- | Build/source/texk/xdvipdfmx/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/tt_post.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Build/source/texk/xdvipdfmx/ChangeLog b/Build/source/texk/xdvipdfmx/ChangeLog index ae781d4a93b..6776875fd6b 100644 --- a/Build/source/texk/xdvipdfmx/ChangeLog +++ b/Build/source/texk/xdvipdfmx/ChangeLog @@ -1,3 +1,8 @@ +2013-01-10 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * read_v2_post_names() in tt_post.c: Change calculation of post->count + for special fonts with unused index. + 2013-01-10 Peter Breitenlohner <peb@mppmu.mpg.de> * src/cid.c: Avoid casts (const char *) -> (char *). diff --git a/Build/source/texk/xdvipdfmx/src/tt_post.c b/Build/source/texk/xdvipdfmx/src/tt_post.c index e7c940539a1..0deb3ab8b23 100644 --- a/Build/source/texk/xdvipdfmx/src/tt_post.c +++ b/Build/source/texk/xdvipdfmx/src/tt_post.c @@ -38,17 +38,19 @@ static const char *macglyphorder[258]; static int read_v2_post_names (struct tt_post_table *post, sfnt *sfont) { - USHORT i, idx, *indices; + USHORT i, idx, *indices, maxidx; int len; post->numberOfGlyphs = sfnt_get_ushort(sfont); indices = NEW(post->numberOfGlyphs, USHORT); - post->count = 0; + maxidx = 257; for (i = 0; i < post->numberOfGlyphs; i++) { idx = sfnt_get_ushort(sfont); if (idx >= 258) { + if (idx > maxidx) + maxidx = idx; if (idx > 32767) { /* Although this is strictly speaking out of spec, it seems to work and there are real-life fonts that use it. @@ -65,11 +67,11 @@ read_v2_post_names (struct tt_post_table *post, sfnt *sfont) in such a case */ idx = 0; } - post->count++; } indices[i] = idx; } + post->count = maxidx - 257; if (post->count < 1) { post->names = NULL; } else { |