diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2015-02-21 15:05:40 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2015-02-21 15:05:40 +0000 |
commit | 43ccbde90e57c6af87ebda0b8f02bd32fdc5b5aa (patch) | |
tree | 71a433d35acbce3242be77ef13329c06c9833707 | |
parent | 5f18ccccb7450dd3c25997ca00600e291a124a34 (diff) |
Fix loading TTC fonts
git-svn-id: svn://tug.org/texlive/trunk@36337 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 3 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/Makefile.am | 2 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/Makefile.in | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvi.c | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/tests/test.ttc | bin | 0 -> 45876 bytes | |||
-rw-r--r-- | Build/source/texk/dvipdfm-x/tests/ttc.dvi | bin | 0 -> 620 bytes | |||
-rw-r--r-- | Build/source/texk/dvipdfm-x/tests/ttc.tex | 3 | ||||
-rwxr-xr-x | Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test | 26 |
8 files changed, 43 insertions, 3 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 79f54495b75..054d1c56bed 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -6,6 +6,9 @@ Fixes the xdvipdfmx-bkm test. * dvi.c (dvi_locate_native_font): fix loading files without absolute paths. + * dvi.c (dvi_locate_native_font): fix loading TTC fonts. + * xdvipdfm-ttc.test, tests/ttc.dvi, tests/ttc.tex, tests/test.ttc, + Makefile.am: new test. 2015-02-21 Akira Kakuto <kakuto@fuk.kindai.ac.jp> diff --git a/Build/source/texk/dvipdfm-x/Makefile.am b/Build/source/texk/dvipdfm-x/Makefile.am index 77c50f3815d..5c31ab7d0de 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.am +++ b/Build/source/texk/dvipdfm-x/Makefile.am @@ -278,6 +278,7 @@ TESTS += $(dvipdfmx_tests) endif DVIPDFMX xdvipdfmx_tests = xdvipdfmx.test xdvipdfm-ann.test xdvipdfm-bb.test xdvipdfm-bkm.test xdvipdfm-psz.test xdvipdfmx_tests += xdvipdfm-res.test +xdvipdfmx_tests += xdvipdfm-ttc.test if XDVIPDFMX TESTS += $(xdvipdfmx_tests) endif XDVIPDFMX @@ -295,4 +296,5 @@ EXTRA_DIST += tests/cmr10.pfb tests/cmr10.tfm tests/annot.dvi tests/annot.tex EXTRA_DIST += tests/bookm.dvi tests/bookm.tex tests/paper.dvi tests/paper.tex EXTRA_DIST += tests/resrc.dvi tests/resrc.tex EXTRA_DIST += tests/xbmc.dvi tests/xbmc.tex tests/xbmc10.600pk tests/xbmc10.tfm +EXTRA_DIST += tests/ttc.dvi tests/ttc.tex tests/test.ttc DISTCLEANFILES += img*.* pic*.* image*.pdf annot*.pdf bookm*.pdf paper*.pdf resrc*.pdf xbmc*.pdf diff --git a/Build/source/texk/dvipdfm-x/Makefile.in b/Build/source/texk/dvipdfm-x/Makefile.in index 6b5cfa6c74d..d97e655f0de 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.in +++ b/Build/source/texk/dvipdfm-x/Makefile.in @@ -836,7 +836,8 @@ TESTS = $(am__append_6) $(am__append_7) dvipdfmx_tests = dvipdfmx.test dvipdfm-ann.test dvipdfm-bb.test \ dvipdfm-bkm.test dvipdfm-psz.test dvipdfm-res.test xdvipdfmx_tests = xdvipdfmx.test xdvipdfm-ann.test xdvipdfm-bb.test \ - xdvipdfm-bkm.test xdvipdfm-psz.test xdvipdfm-res.test + xdvipdfm-bkm.test xdvipdfm-psz.test xdvipdfm-res.test \ + xdvipdfm-ttc.test EXTRA_DIST = $(dvipdfmx_tests) $(xdvipdfmx_tests) tests/dvipdfmx.cfg \ tests/psfonts.map tests/fullmap.dvi tests/fullmap.tex \ tests/image.bmp tests/imgbmp.bb tests/imgbmp.xbb \ @@ -852,7 +853,8 @@ EXTRA_DIST = $(dvipdfmx_tests) $(xdvipdfmx_tests) tests/dvipdfmx.cfg \ tests/annot.tex tests/bookm.dvi tests/bookm.tex \ tests/paper.dvi tests/paper.tex tests/resrc.dvi \ tests/resrc.tex tests/xbmc.dvi tests/xbmc.tex \ - tests/xbmc10.600pk tests/xbmc10.tfm + tests/xbmc10.600pk tests/xbmc10.tfm tests/ttc.dvi \ + tests/ttc.tex tests/test.ttc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c index f9a079eeba3..e5f260d1e20 100644 --- a/Build/source/texk/dvipdfm-x/dvi.c +++ b/Build/source/texk/dvipdfm-x/dvi.c @@ -63,6 +63,7 @@ #ifdef XETEX #include "dpxfile.h" #include "pdfximage.h" +#include "tt_aux.h" #include "tt_table.h" #endif @@ -924,6 +925,7 @@ dvi_locate_native_font (const char *filename, uint32_t index, FILE *fp; char *path = strdup(filename); sfnt *sfont; + unsigned offset = 0; struct tt_head_table *head; struct tt_maxp_table *maxp; struct tt_hhea_table *hhea; @@ -964,7 +966,9 @@ dvi_locate_native_font (const char *filename, uint32_t index, free(fontmap_key); sfont = sfnt_open(fp); - sfnt_read_table_directory(sfont, 0); + if (sfont->type == SFNT_TYPE_TTC) + offset = ttc_read_offset(sfont, index); + sfnt_read_table_directory(sfont, offset); head = tt_read_head_table(sfont); maxp = tt_read_maxp_table(sfont); hhea = tt_read_hhea_table(sfont); diff --git a/Build/source/texk/dvipdfm-x/tests/test.ttc b/Build/source/texk/dvipdfm-x/tests/test.ttc Binary files differnew file mode 100644 index 00000000000..2eea577e9c1 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/test.ttc diff --git a/Build/source/texk/dvipdfm-x/tests/ttc.dvi b/Build/source/texk/dvipdfm-x/tests/ttc.dvi Binary files differnew file mode 100644 index 00000000000..31e3843ac16 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/ttc.dvi diff --git a/Build/source/texk/dvipdfm-x/tests/ttc.tex b/Build/source/texk/dvipdfm-x/tests/ttc.tex new file mode 100644 index 00000000000..b9efd5d0038 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/ttc.tex @@ -0,0 +1,3 @@ +\font\test="[test.ttc:0]"\test This is a test +\font\test="[test.ttc:1]"\test This is a test +\bye diff --git a/Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test b/Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test new file mode 100755 index 00000000000..c3e85770370 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/xdvipdfm-ttc.test @@ -0,0 +1,26 @@ +#! /bin/sh + +# Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org> +# You may freely use, modify and/or distribute this file. + +TEXMFCNF=$srcdir/../kpathsea +TFMFONTS="$srcdir/tests;$srcdir/data" +T1FONTS="$srcdir/tests;$srcdir/data" +TTFONTS="$srcdir/tests;$srcdir/data" +TEXFONTMAPS="$srcdir/tests;$srcdir/data" +DVIPDFMXINPUTS="$srcdir/tests;$srcdir/data" +TEXPICTS=$srcdir/tests +export TEXMFCNF TFMFONTS T1FONTS TEXFONTMAPS DVIPDFMXINPUTS TEXPICTS + +failed= + +echo "*** xdvipdfmx -v -z0 -o ttc2.pdf ttc" && echo \ + && ./xdvipdfmx -z0 -o ttc2.pdf $srcdir/tests/ttc \ + && echo && echo "xdvipdfmx-ttc tests OK" && echo \ + || failed="$failed xdvipdfmx-ttc" + +test -z "$failed" && exit 0 +echo +echo "failed tests:$failed" +exit 1 + |