summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan The Thanh <hanthethanh@gmail.com>2009-09-16 12:12:39 +0000
committerHan The Thanh <hanthethanh@gmail.com>2009-09-16 12:12:39 +0000
commita329fdb10f6774ab9132568cace23eebe8becdab (patch)
treef408dbe2d175a5071482163160c363b096e5a12f
parenteab8b8e8ffca0def6bb56007177689b26b7de2ec (diff)
patch for TTC from Liu Yubao <yubao.liu@gmail.com>
git-svn-id: svn://tug.org/texlive/trunk@15314 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog3
-rw-r--r--Build/source/texk/web2c/pdftexdir/writettf.c14
2 files changed, 17 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index 4e824f900bf..24378872da5 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,6 @@
+2009-09-16 Han The Thanh <hanthethanh@gmail.com>
+ * writettf.c: patch for TTC from Liu Yubao <yubao.liu@gmail.com>
+
2009-08-12 Karl Berry <karl@tug.org>
* pdftex.web (sup_dest_names_size): increase to 500000;
diff --git a/Build/source/texk/web2c/pdftexdir/writettf.c b/Build/source/texk/web2c/pdftexdir/writettf.c
index 211e750f295..d6711b486c2 100644
--- a/Build/source/texk/web2c/pdftexdir/writettf.c
+++ b/Build/source/texk/web2c/pdftexdir/writettf.c
@@ -1344,6 +1344,20 @@ void writettf(fd_entry * fd)
pdftex_fail("cannot open TrueType font file for reading");
}
cur_file_name = (char *) nameoffile + 1;
+
+ /* skip ttc header, prepare for reading first font */
+ if (strcasecmp(strchr(cur_file_name, 0) - 4, ".ttc") == 0) {
+ if (get_ulong() != 0x74746366 /* ttcf */) {
+ xfseek(INFILE, 0, SEEK_SET, cur_file_name);
+ } else {
+ ttf_skip(TTF_FIXED_SIZE); /* ignore the version */
+ ttf_skip(TTF_ULONG_SIZE); /* ignore the numFonts */
+
+ /* goto first font */
+ xfseek(INFILE, get_ulong(), SEEK_SET, cur_file_name);
+ }
+ }
+
if (is_subsetted(fd_cur->fm))
tex_printf("<%s", cur_file_name);
else