summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-01-10 14:06:19 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-01-10 14:06:19 +0000
commit4a436b90db469ffdab8ae4fea378e64ecf3f4b20 (patch)
treea7b9661620ed36e357df638b552cb920fc629871 /Build
parentc742c565b82f2588cda3e544f90281254b569bc1 (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')
-rw-r--r--Build/source/texk/dvipdfmx/ChangeLog5
-rw-r--r--Build/source/texk/dvipdfmx/src/tt_post.c10
-rw-r--r--Build/source/texk/xdvipdfmx/ChangeLog5
-rw-r--r--Build/source/texk/xdvipdfmx/src/tt_post.c8
4 files changed, 21 insertions, 7 deletions
diff --git a/Build/source/texk/dvipdfmx/ChangeLog b/Build/source/texk/dvipdfmx/ChangeLog
index 5fe4b753127..2624bcfd355 100644
--- a/Build/source/texk/dvipdfmx/ChangeLog
+++ b/Build/source/texk/dvipdfmx/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/dvipdfmx/src/tt_post.c b/Build/source/texk/dvipdfmx/src/tt_post.c
index 8c6f6e293d0..46adba1afcf 100644
--- a/Build/source/texk/dvipdfmx/src/tt_post.c
+++ b/Build/source/texk/dvipdfmx/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 {
@@ -185,7 +187,7 @@ tt_release_post_table (struct tt_post_table *post)
ASSERT(post);
if (post->glyphNamePtr && post->Version != 0x00010000UL)
- RELEASE(post->glyphNamePtr);
+ RELEASE((void *)post->glyphNamePtr);
if (post->names) {
for (i = 0; i < post->count; i++) {
if (post->names[i])
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 {