diff options
author | Han The Thanh <hanthethanh@gmail.com> | 2008-07-03 16:11:52 +0000 |
---|---|---|
committer | Han The Thanh <hanthethanh@gmail.com> | 2008-07-03 16:11:52 +0000 |
commit | c2c5c262b00a301d7731c9422843454457fb4429 (patch) | |
tree | b7718cf68b709954f17758871b7580fa07891ecb /Build/source/texk/web2c/pdftexdir/ttf2afm.c | |
parent | c51e576c58e88a1f340770fe162fb2c1ac98ff87 (diff) |
some bugfixes for pdftex:
- a bugfix for TrueType font handling
- a bugfix for pdf inclusion
git-svn-id: svn://tug.org/texlive/trunk@9192 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir/ttf2afm.c')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ttf2afm.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ttf2afm.c b/Build/source/texk/web2c/pdftexdir/ttf2afm.c index e5916cfeb24..ef6563f186c 100644 --- a/Build/source/texk/web2c/pdftexdir/ttf2afm.c +++ b/Build/source/texk/web2c/pdftexdir/ttf2afm.c @@ -117,7 +117,7 @@ TTF_USHORT ntabs; int nhmtx; int post_format; int loca_format; -int nglyphs; +long nglyphs; int nkernpairs = 0; int names_count = 0; char *ps_glyphs_buf = NULL; @@ -533,8 +533,13 @@ void read_font() ttf_fail("unsupported format (%.8X) of `post' table", post_format); } ttf_seek_tab("loca", 0); - for (pm = mtx_tab; pm - mtx_tab < nglyphs + 1; pm++) - pm->offset = (loca_format == 1 ? get_ulong() : get_ushort() << 1); + if (loca_format == 1) { + for (pm = mtx_tab; pm - mtx_tab < nglyphs + 1; pm++) + pm->offset = get_ulong(); + } else { + for (pm = mtx_tab; pm - mtx_tab < nglyphs + 1; pm++) + pm->offset = get_ushort() << 1; + } if ((pd = name_lookup("glyf")) == NULL) ttf_fail("can't find table `glyf'"); for (n = pd->offset, pm = mtx_tab; pm - mtx_tab < nglyphs; pm++) { @@ -748,7 +753,7 @@ void print_afm(char *date, char *fontname) { int ncharmetrics; mtx_entry *pm; - short mtx_index[256], *idx; + long mtx_index[256], *idx; unsigned int index; char **pe; kern_entry *pk, *qk; @@ -804,7 +809,7 @@ void print_afm(char *date, char *fontname) } /* scan form `index123' */ if (sscanf(*pe, GLYPH_PREFIX_INDEX "%u", &index) == 1) { - if (index >= nglyphs) + if (index >= (unsigned int) nglyphs) ttf_fail("`%s' out of valid range [0..%i)", *pe, nglyphs); pm = mtx_tab + index; mtx_index[pe - enc_names] = pm - mtx_tab; |