From bafcd628ab422e43e5ead345d239bbc6af9fc568 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Wed, 3 Jul 2013 10:15:17 +0000 Subject: Merging dvipdfmx and xdvipdfmx (continue) git-svn-id: svn://tug.org/texlive/trunk@31083 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfm-x/ChangeLog | 12 + Build/source/texk/dvipdfm-x/Makefile.am | 33 +- Build/source/texk/dvipdfm-x/Makefile.in | 218 +++-- Build/source/texk/dvipdfm-x/dpxfile.c | 1178 ++++++++++++++++++++++++++ Build/source/texk/dvipdfm-x/dpxfile.h | 70 ++ Build/source/texk/dvipdfm-x/fontmap.h | 109 +++ Build/source/texk/dvipdfm-x/jpegimage.h | 38 + Build/source/texk/dvipdfm-x/pngimage.h | 41 + Build/source/texk/dvipdfm-x/src/cff_dict.c | 2 +- Build/source/texk/dvipdfm-x/src/cidtype0.c | 29 + Build/source/texk/dvipdfm-x/src/cidtype2.c | 26 +- Build/source/texk/dvipdfm-x/src/dpxfile.c | 1153 ------------------------- Build/source/texk/dvipdfm-x/src/dpxfile.h | 65 -- Build/source/texk/dvipdfm-x/src/dvipdfmx.c | 4 +- Build/source/texk/dvipdfm-x/src/fontmap.h | 111 --- Build/source/texk/dvipdfm-x/src/jpegimage.c | 2 +- Build/source/texk/dvipdfm-x/src/jpegimage.h | 38 - Build/source/texk/dvipdfm-x/src/pdfencrypt.c | 2 +- Build/source/texk/dvipdfm-x/src/pdfparse.c | 2 +- Build/source/texk/dvipdfm-x/src/pngimage.c | 2 +- Build/source/texk/dvipdfm-x/src/pngimage.h | 41 - Build/source/texk/dvipdfm-x/src/spc_html.c | 2 +- Build/source/texk/dvipdfm-x/src/tt_cmap.c | 8 + Build/source/texk/dvipdfm-x/src/tt_cmap.h | 79 -- Build/source/texk/dvipdfm-x/src/tt_table.c | 31 +- Build/source/texk/dvipdfm-x/src/type0.h | 56 -- Build/source/texk/dvipdfm-x/src/vf.c | 1058 ----------------------- Build/source/texk/dvipdfm-x/src/xbb.c | 4 +- Build/source/texk/dvipdfm-x/src/xbb.h | 31 - Build/source/texk/dvipdfm-x/tt_cmap.h | 82 ++ Build/source/texk/dvipdfm-x/type0.h | 60 ++ Build/source/texk/dvipdfm-x/vf.c | 1075 +++++++++++++++++++++++ Build/source/texk/dvipdfm-x/xbb.h | 31 + Build/source/texk/dvipdfm-x/xsrc/cidtype0.c | 3 +- Build/source/texk/dvipdfm-x/xsrc/cidtype2.c | 11 +- Build/source/texk/dvipdfm-x/xsrc/dpxfile.c | 1175 ------------------------- Build/source/texk/dvipdfm-x/xsrc/dpxfile.h | 70 -- Build/source/texk/dvipdfm-x/xsrc/dvipdfmx.c | 2 +- Build/source/texk/dvipdfm-x/xsrc/fontmap.h | 109 --- Build/source/texk/dvipdfm-x/xsrc/jpegimage.h | 36 - Build/source/texk/dvipdfm-x/xsrc/pngimage.h | 39 - Build/source/texk/dvipdfm-x/xsrc/tt_cmap.c | 2 + Build/source/texk/dvipdfm-x/xsrc/tt_cmap.h | 80 -- Build/source/texk/dvipdfm-x/xsrc/tt_table.c | 17 +- Build/source/texk/dvipdfm-x/xsrc/type0.h | 58 -- Build/source/texk/dvipdfm-x/xsrc/vf.c | 1042 ----------------------- Build/source/texk/dvipdfm-x/xsrc/xbb.h | 31 - 47 files changed, 2913 insertions(+), 5455 deletions(-) create mode 100644 Build/source/texk/dvipdfm-x/dpxfile.c create mode 100644 Build/source/texk/dvipdfm-x/dpxfile.h create mode 100644 Build/source/texk/dvipdfm-x/fontmap.h create mode 100644 Build/source/texk/dvipdfm-x/jpegimage.h create mode 100644 Build/source/texk/dvipdfm-x/pngimage.h delete mode 100644 Build/source/texk/dvipdfm-x/src/dpxfile.c delete mode 100644 Build/source/texk/dvipdfm-x/src/dpxfile.h delete mode 100644 Build/source/texk/dvipdfm-x/src/fontmap.h delete mode 100644 Build/source/texk/dvipdfm-x/src/jpegimage.h delete mode 100644 Build/source/texk/dvipdfm-x/src/pngimage.h delete mode 100644 Build/source/texk/dvipdfm-x/src/tt_cmap.h delete mode 100644 Build/source/texk/dvipdfm-x/src/type0.h delete mode 100644 Build/source/texk/dvipdfm-x/src/vf.c delete mode 100644 Build/source/texk/dvipdfm-x/src/xbb.h create mode 100644 Build/source/texk/dvipdfm-x/tt_cmap.h create mode 100644 Build/source/texk/dvipdfm-x/type0.h create mode 100644 Build/source/texk/dvipdfm-x/vf.c create mode 100644 Build/source/texk/dvipdfm-x/xbb.h delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/dpxfile.c delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/dpxfile.h delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/fontmap.h delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/jpegimage.h delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/pngimage.h delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/tt_cmap.h delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/type0.h delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/vf.c delete mode 100644 Build/source/texk/dvipdfm-x/xsrc/xbb.h (limited to 'Build/source/texk') diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 1f5b2b5dba7..4e7c2aef904 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,15 @@ +2013-07-03 Peter Breitenlohner + + * Removed diffs between src/ and xsrc/ version of these files + and moved them to the top-level: dpxfile.[ch], fontmap.h, + jpegimage.h, pngimage.h, tt_cmap.h, type0.h, vf.c, xbb.h. + + * Reduced dvipdfmx/xdvipdfmx diffs in these files: + src/cff_dict.c, (x)src/cidtype0.c, (x)src/cidtype2.c, + (x)src/dvipdfmx.c, (x)src/jpegimage.c, src/pdfencrypt.c, + src/pdfparse.c, src/pngimage.c, src/spc_html.c, + (x)src/tt_cmap.c, (x)src/tt_table.c, src/xbb.c. + 2013-07-01 Peter Breitenlohner * data/Makefile.am, man/Makefile.am (removed): Merged into ... diff --git a/Build/source/texk/dvipdfm-x/Makefile.am b/Build/source/texk/dvipdfm-x/Makefile.am index e763c515388..89f25406904 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.am +++ b/Build/source/texk/dvipdfm-x/Makefile.am @@ -57,11 +57,15 @@ common_sources = \ dpxconf.h \ dpxcrypt.c \ dpxcrypt.h \ + dpxfile.c \ + dpxfile.h \ dpxutil.c \ dpxutil.h \ dvicodes.h \ error.c \ error.h \ + fontmap.h \ + jpegimage.h \ mem.c \ mem.h \ mfileio.c \ @@ -84,6 +88,7 @@ common_sources = \ pdfresource.h \ pkfont.c \ pkfont.h \ + pngimage.h \ pst.c \ pst.h \ pst_obj.c \ @@ -106,16 +111,20 @@ common_sources = \ t1_load.h \ tfm.h \ truetype.h \ + tt_cmap.h \ tt_glyf.h \ tt_gsub.c \ tt_gsub.h \ tt_post.h \ tt_table.h \ + type0.h \ type1.h \ type1c.h \ unicode.c \ unicode.h \ - vf.h + vf.c \ + vf.h \ + xbb.h dvipdfmx_sources = \ src/bmpimage.c \ @@ -124,8 +133,6 @@ dvipdfmx_sources = \ src/cff_dict.c \ src/cidtype0.c \ src/cidtype2.c \ - src/dpxfile.c \ - src/dpxfile.h \ src/dvi.c \ src/dvi.h \ src/dvipdfmx.c \ @@ -133,9 +140,7 @@ dvipdfmx_sources = \ src/epdf.c \ src/epdf.h \ src/fontmap.c \ - src/fontmap.h \ src/jpegimage.c \ - src/jpegimage.h \ src/mpost.c \ src/pdfcolor.c \ src/pdfcolor.h \ @@ -154,7 +159,6 @@ dvipdfmx_sources = \ src/pdfximage.c \ src/pdfximage.h \ src/pngimage.c \ - src/pngimage.h \ src/sfnt.c \ src/spc_color.c \ src/spc_dvips.c \ @@ -169,17 +173,13 @@ dvipdfmx_sources = \ src/tt_aux.c \ src/tt_aux.h \ src/tt_cmap.c \ - src/tt_cmap.h \ src/tt_glyf.c \ src/tt_post.c \ src/tt_table.c \ src/type0.c \ - src/type0.h \ src/type1.c \ src/type1c.c \ - src/vf.c \ - src/xbb.c \ - src/xbb.h + src/xbb.c xdvipdfmx_sources = \ xsrc/bmpimage.c \ @@ -188,17 +188,13 @@ xdvipdfmx_sources = \ xsrc/cff_dict.c \ xsrc/cidtype0.c \ xsrc/cidtype2.c \ - xsrc/dpxfile.c \ - xsrc/dpxfile.h \ xsrc/dvi.c \ xsrc/dvi.h \ xsrc/dvipdfmx.c \ xsrc/epdf.c \ xsrc/epdf.h \ xsrc/fontmap.c \ - xsrc/fontmap.h \ xsrc/jpegimage.c \ - xsrc/jpegimage.h \ xsrc/mpost.c \ xsrc/pdfcolor.c \ xsrc/pdfcolor.h \ @@ -217,7 +213,6 @@ xdvipdfmx_sources = \ xsrc/pdfximage.c \ xsrc/pdfximage.h \ xsrc/pngimage.c \ - xsrc/pngimage.h \ xsrc/sfnt.c \ xsrc/spc_color.c \ xsrc/spc_dvips.c \ @@ -234,17 +229,13 @@ xdvipdfmx_sources = \ xsrc/tt_aux.c \ xsrc/tt_aux.h \ xsrc/tt_cmap.c \ - xsrc/tt_cmap.h \ xsrc/tt_glyf.c \ xsrc/tt_post.c \ xsrc/tt_table.c \ xsrc/type0.c \ - xsrc/type0.h \ xsrc/type1.c \ xsrc/type1c.c \ - xsrc/vf.c \ - xsrc/xbb.c \ - xsrc/xbb.h + xsrc/xbb.c EXTRA_DIST = $(common_sources) $(dvipdfmx_sources) $(xdvipdfmx_sources) diff --git a/Build/source/texk/dvipdfm-x/Makefile.in b/Build/source/texk/dvipdfm-x/Makefile.in index 8f55c85dc2c..75134507004 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.in +++ b/Build/source/texk/dvipdfm-x/Makefile.in @@ -157,23 +157,24 @@ am__objects_1 = dvipdfmx-agl.$(OBJEXT) dvipdfmx-cid.$(OBJEXT) \ dvipdfmx-cmap.$(OBJEXT) dvipdfmx-cmap_read.$(OBJEXT) \ dvipdfmx-cmap_write.$(OBJEXT) dvipdfmx-cs_type2.$(OBJEXT) \ dvipdfmx-dpxconf.$(OBJEXT) dvipdfmx-dpxcrypt.$(OBJEXT) \ - dvipdfmx-dpxutil.$(OBJEXT) dvipdfmx-error.$(OBJEXT) \ - dvipdfmx-mem.$(OBJEXT) dvipdfmx-mfileio.$(OBJEXT) \ - dvipdfmx-numbers.$(OBJEXT) dvipdfmx-otl_conf.$(OBJEXT) \ - dvipdfmx-otl_opt.$(OBJEXT) dvipdfmx-pdfencoding.$(OBJEXT) \ - dvipdfmx-pdffont.$(OBJEXT) dvipdfmx-pdfresource.$(OBJEXT) \ - dvipdfmx-pkfont.$(OBJEXT) dvipdfmx-pst.$(OBJEXT) \ - dvipdfmx-pst_obj.$(OBJEXT) dvipdfmx-spc_misc.$(OBJEXT) \ - dvipdfmx-subfont.$(OBJEXT) dvipdfmx-t1_char.$(OBJEXT) \ - dvipdfmx-t1_load.$(OBJEXT) dvipdfmx-tt_gsub.$(OBJEXT) \ - dvipdfmx-unicode.$(OBJEXT) + dvipdfmx-dpxfile.$(OBJEXT) dvipdfmx-dpxutil.$(OBJEXT) \ + dvipdfmx-error.$(OBJEXT) dvipdfmx-mem.$(OBJEXT) \ + dvipdfmx-mfileio.$(OBJEXT) dvipdfmx-numbers.$(OBJEXT) \ + dvipdfmx-otl_conf.$(OBJEXT) dvipdfmx-otl_opt.$(OBJEXT) \ + dvipdfmx-pdfencoding.$(OBJEXT) dvipdfmx-pdffont.$(OBJEXT) \ + dvipdfmx-pdfresource.$(OBJEXT) dvipdfmx-pkfont.$(OBJEXT) \ + dvipdfmx-pst.$(OBJEXT) dvipdfmx-pst_obj.$(OBJEXT) \ + dvipdfmx-spc_misc.$(OBJEXT) dvipdfmx-subfont.$(OBJEXT) \ + dvipdfmx-t1_char.$(OBJEXT) dvipdfmx-t1_load.$(OBJEXT) \ + dvipdfmx-tt_gsub.$(OBJEXT) dvipdfmx-unicode.$(OBJEXT) \ + dvipdfmx-vf.$(OBJEXT) am__dirstamp = $(am__leading_dot)dirstamp am__objects_2 = src/dvipdfmx-bmpimage.$(OBJEXT) \ src/dvipdfmx-cff.$(OBJEXT) src/dvipdfmx-cff_dict.$(OBJEXT) \ src/dvipdfmx-cidtype0.$(OBJEXT) \ - src/dvipdfmx-cidtype2.$(OBJEXT) src/dvipdfmx-dpxfile.$(OBJEXT) \ - src/dvipdfmx-dvi.$(OBJEXT) src/dvipdfmx-dvipdfmx.$(OBJEXT) \ - src/dvipdfmx-epdf.$(OBJEXT) src/dvipdfmx-fontmap.$(OBJEXT) \ + src/dvipdfmx-cidtype2.$(OBJEXT) src/dvipdfmx-dvi.$(OBJEXT) \ + src/dvipdfmx-dvipdfmx.$(OBJEXT) src/dvipdfmx-epdf.$(OBJEXT) \ + src/dvipdfmx-fontmap.$(OBJEXT) \ src/dvipdfmx-jpegimage.$(OBJEXT) src/dvipdfmx-mpost.$(OBJEXT) \ src/dvipdfmx-pdfcolor.$(OBJEXT) src/dvipdfmx-pdfdev.$(OBJEXT) \ src/dvipdfmx-pdfdoc.$(OBJEXT) src/dvipdfmx-pdfdraw.$(OBJEXT) \ @@ -193,8 +194,7 @@ am__objects_2 = src/dvipdfmx-bmpimage.$(OBJEXT) \ src/dvipdfmx-tt_cmap.$(OBJEXT) src/dvipdfmx-tt_glyf.$(OBJEXT) \ src/dvipdfmx-tt_post.$(OBJEXT) src/dvipdfmx-tt_table.$(OBJEXT) \ src/dvipdfmx-type0.$(OBJEXT) src/dvipdfmx-type1.$(OBJEXT) \ - src/dvipdfmx-type1c.$(OBJEXT) src/dvipdfmx-vf.$(OBJEXT) \ - src/dvipdfmx-xbb.$(OBJEXT) + src/dvipdfmx-type1c.$(OBJEXT) src/dvipdfmx-xbb.$(OBJEXT) nodist_dvipdfmx_OBJECTS = $(am__objects_1) $(am__objects_2) dvipdfmx_OBJECTS = $(nodist_dvipdfmx_OBJECTS) am__DEPENDENCIES_1 = @@ -204,21 +204,21 @@ am__objects_3 = xdvipdfmx-agl.$(OBJEXT) xdvipdfmx-cid.$(OBJEXT) \ xdvipdfmx-cmap.$(OBJEXT) xdvipdfmx-cmap_read.$(OBJEXT) \ xdvipdfmx-cmap_write.$(OBJEXT) xdvipdfmx-cs_type2.$(OBJEXT) \ xdvipdfmx-dpxconf.$(OBJEXT) xdvipdfmx-dpxcrypt.$(OBJEXT) \ - xdvipdfmx-dpxutil.$(OBJEXT) xdvipdfmx-error.$(OBJEXT) \ - xdvipdfmx-mem.$(OBJEXT) xdvipdfmx-mfileio.$(OBJEXT) \ - xdvipdfmx-numbers.$(OBJEXT) xdvipdfmx-otl_conf.$(OBJEXT) \ - xdvipdfmx-otl_opt.$(OBJEXT) xdvipdfmx-pdfencoding.$(OBJEXT) \ - xdvipdfmx-pdffont.$(OBJEXT) xdvipdfmx-pdfresource.$(OBJEXT) \ - xdvipdfmx-pkfont.$(OBJEXT) xdvipdfmx-pst.$(OBJEXT) \ - xdvipdfmx-pst_obj.$(OBJEXT) xdvipdfmx-spc_misc.$(OBJEXT) \ - xdvipdfmx-subfont.$(OBJEXT) xdvipdfmx-t1_char.$(OBJEXT) \ - xdvipdfmx-t1_load.$(OBJEXT) xdvipdfmx-tt_gsub.$(OBJEXT) \ - xdvipdfmx-unicode.$(OBJEXT) + xdvipdfmx-dpxfile.$(OBJEXT) xdvipdfmx-dpxutil.$(OBJEXT) \ + xdvipdfmx-error.$(OBJEXT) xdvipdfmx-mem.$(OBJEXT) \ + xdvipdfmx-mfileio.$(OBJEXT) xdvipdfmx-numbers.$(OBJEXT) \ + xdvipdfmx-otl_conf.$(OBJEXT) xdvipdfmx-otl_opt.$(OBJEXT) \ + xdvipdfmx-pdfencoding.$(OBJEXT) xdvipdfmx-pdffont.$(OBJEXT) \ + xdvipdfmx-pdfresource.$(OBJEXT) xdvipdfmx-pkfont.$(OBJEXT) \ + xdvipdfmx-pst.$(OBJEXT) xdvipdfmx-pst_obj.$(OBJEXT) \ + xdvipdfmx-spc_misc.$(OBJEXT) xdvipdfmx-subfont.$(OBJEXT) \ + xdvipdfmx-t1_char.$(OBJEXT) xdvipdfmx-t1_load.$(OBJEXT) \ + xdvipdfmx-tt_gsub.$(OBJEXT) xdvipdfmx-unicode.$(OBJEXT) \ + xdvipdfmx-vf.$(OBJEXT) am__objects_4 = xsrc/xdvipdfmx-bmpimage.$(OBJEXT) \ xsrc/xdvipdfmx-cff.$(OBJEXT) xsrc/xdvipdfmx-cff_dict.$(OBJEXT) \ xsrc/xdvipdfmx-cidtype0.$(OBJEXT) \ - xsrc/xdvipdfmx-cidtype2.$(OBJEXT) \ - xsrc/xdvipdfmx-dpxfile.$(OBJEXT) xsrc/xdvipdfmx-dvi.$(OBJEXT) \ + xsrc/xdvipdfmx-cidtype2.$(OBJEXT) xsrc/xdvipdfmx-dvi.$(OBJEXT) \ xsrc/xdvipdfmx-dvipdfmx.$(OBJEXT) \ xsrc/xdvipdfmx-epdf.$(OBJEXT) xsrc/xdvipdfmx-fontmap.$(OBJEXT) \ xsrc/xdvipdfmx-jpegimage.$(OBJEXT) \ @@ -248,8 +248,7 @@ am__objects_4 = xsrc/xdvipdfmx-bmpimage.$(OBJEXT) \ xsrc/xdvipdfmx-tt_post.$(OBJEXT) \ xsrc/xdvipdfmx-tt_table.$(OBJEXT) \ xsrc/xdvipdfmx-type0.$(OBJEXT) xsrc/xdvipdfmx-type1.$(OBJEXT) \ - xsrc/xdvipdfmx-type1c.$(OBJEXT) xsrc/xdvipdfmx-vf.$(OBJEXT) \ - xsrc/xdvipdfmx-xbb.$(OBJEXT) + xsrc/xdvipdfmx-type1c.$(OBJEXT) xsrc/xdvipdfmx-xbb.$(OBJEXT) nodist_xdvipdfmx_OBJECTS = $(am__objects_3) $(am__objects_4) xdvipdfmx_OBJECTS = $(nodist_xdvipdfmx_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @@ -712,11 +711,15 @@ common_sources = \ dpxconf.h \ dpxcrypt.c \ dpxcrypt.h \ + dpxfile.c \ + dpxfile.h \ dpxutil.c \ dpxutil.h \ dvicodes.h \ error.c \ error.h \ + fontmap.h \ + jpegimage.h \ mem.c \ mem.h \ mfileio.c \ @@ -739,6 +742,7 @@ common_sources = \ pdfresource.h \ pkfont.c \ pkfont.h \ + pngimage.h \ pst.c \ pst.h \ pst_obj.c \ @@ -761,16 +765,20 @@ common_sources = \ t1_load.h \ tfm.h \ truetype.h \ + tt_cmap.h \ tt_glyf.h \ tt_gsub.c \ tt_gsub.h \ tt_post.h \ tt_table.h \ + type0.h \ type1.h \ type1c.h \ unicode.c \ unicode.h \ - vf.h + vf.c \ + vf.h \ + xbb.h dvipdfmx_sources = \ src/bmpimage.c \ @@ -779,8 +787,6 @@ dvipdfmx_sources = \ src/cff_dict.c \ src/cidtype0.c \ src/cidtype2.c \ - src/dpxfile.c \ - src/dpxfile.h \ src/dvi.c \ src/dvi.h \ src/dvipdfmx.c \ @@ -788,9 +794,7 @@ dvipdfmx_sources = \ src/epdf.c \ src/epdf.h \ src/fontmap.c \ - src/fontmap.h \ src/jpegimage.c \ - src/jpegimage.h \ src/mpost.c \ src/pdfcolor.c \ src/pdfcolor.h \ @@ -809,7 +813,6 @@ dvipdfmx_sources = \ src/pdfximage.c \ src/pdfximage.h \ src/pngimage.c \ - src/pngimage.h \ src/sfnt.c \ src/spc_color.c \ src/spc_dvips.c \ @@ -824,17 +827,13 @@ dvipdfmx_sources = \ src/tt_aux.c \ src/tt_aux.h \ src/tt_cmap.c \ - src/tt_cmap.h \ src/tt_glyf.c \ src/tt_post.c \ src/tt_table.c \ src/type0.c \ - src/type0.h \ src/type1.c \ src/type1c.c \ - src/vf.c \ - src/xbb.c \ - src/xbb.h + src/xbb.c xdvipdfmx_sources = \ xsrc/bmpimage.c \ @@ -843,17 +842,13 @@ xdvipdfmx_sources = \ xsrc/cff_dict.c \ xsrc/cidtype0.c \ xsrc/cidtype2.c \ - xsrc/dpxfile.c \ - xsrc/dpxfile.h \ xsrc/dvi.c \ xsrc/dvi.h \ xsrc/dvipdfmx.c \ xsrc/epdf.c \ xsrc/epdf.h \ xsrc/fontmap.c \ - xsrc/fontmap.h \ xsrc/jpegimage.c \ - xsrc/jpegimage.h \ xsrc/mpost.c \ xsrc/pdfcolor.c \ xsrc/pdfcolor.h \ @@ -872,7 +867,6 @@ xdvipdfmx_sources = \ xsrc/pdfximage.c \ xsrc/pdfximage.h \ xsrc/pngimage.c \ - xsrc/pngimage.h \ xsrc/sfnt.c \ xsrc/spc_color.c \ xsrc/spc_dvips.c \ @@ -889,17 +883,13 @@ xdvipdfmx_sources = \ xsrc/tt_aux.c \ xsrc/tt_aux.h \ xsrc/tt_cmap.c \ - xsrc/tt_cmap.h \ xsrc/tt_glyf.c \ xsrc/tt_post.c \ xsrc/tt_table.c \ xsrc/type0.c \ - xsrc/type0.h \ xsrc/type1.c \ xsrc/type1c.c \ - xsrc/vf.c \ - xsrc/xbb.c \ - xsrc/xbb.h + xsrc/xbb.c EXTRA_DIST = $(common_sources) $(dvipdfmx_sources) \ $(xdvipdfmx_sources) dvipdfmx.test xdvipdfmx.test @@ -1054,8 +1044,6 @@ src/dvipdfmx-cidtype0.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/dvipdfmx-cidtype2.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) -src/dvipdfmx-dpxfile.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) src/dvipdfmx-dvi.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/dvipdfmx-dvipdfmx.$(OBJEXT): src/$(am__dirstamp) \ @@ -1124,8 +1112,6 @@ src/dvipdfmx-type1.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/dvipdfmx-type1c.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) -src/dvipdfmx-vf.$(OBJEXT): src/$(am__dirstamp) \ - src/$(DEPDIR)/$(am__dirstamp) src/dvipdfmx-xbb.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) @@ -1148,8 +1134,6 @@ xsrc/xdvipdfmx-cidtype0.$(OBJEXT): xsrc/$(am__dirstamp) \ xsrc/$(DEPDIR)/$(am__dirstamp) xsrc/xdvipdfmx-cidtype2.$(OBJEXT): xsrc/$(am__dirstamp) \ xsrc/$(DEPDIR)/$(am__dirstamp) -xsrc/xdvipdfmx-dpxfile.$(OBJEXT): xsrc/$(am__dirstamp) \ - xsrc/$(DEPDIR)/$(am__dirstamp) xsrc/xdvipdfmx-dvi.$(OBJEXT): xsrc/$(am__dirstamp) \ xsrc/$(DEPDIR)/$(am__dirstamp) xsrc/xdvipdfmx-dvipdfmx.$(OBJEXT): xsrc/$(am__dirstamp) \ @@ -1218,8 +1202,6 @@ xsrc/xdvipdfmx-type1.$(OBJEXT): xsrc/$(am__dirstamp) \ xsrc/$(DEPDIR)/$(am__dirstamp) xsrc/xdvipdfmx-type1c.$(OBJEXT): xsrc/$(am__dirstamp) \ xsrc/$(DEPDIR)/$(am__dirstamp) -xsrc/xdvipdfmx-vf.$(OBJEXT): xsrc/$(am__dirstamp) \ - xsrc/$(DEPDIR)/$(am__dirstamp) xsrc/xdvipdfmx-xbb.$(OBJEXT): xsrc/$(am__dirstamp) \ xsrc/$(DEPDIR)/$(am__dirstamp) @@ -1279,6 +1261,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-cs_type2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-dpxconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-dpxcrypt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-dpxfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-dpxutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-mem.Po@am__quote@ @@ -1298,6 +1281,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-t1_load.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-tt_gsub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-unicode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dvipdfmx-vf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-agl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-cid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-cmap.Po@am__quote@ @@ -1306,6 +1290,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-cs_type2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-dpxconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-dpxcrypt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-dpxfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-dpxutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-mem.Po@am__quote@ @@ -1326,12 +1311,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-t1_load.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-tt_gsub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-unicode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdvipdfmx-vf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-bmpimage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-cff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-cff_dict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-cidtype0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-cidtype2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-dpxfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-dvi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-dvipdfmx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-epdf.Po@am__quote@ @@ -1366,14 +1351,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-type0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-type1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-type1c.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-vf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/dvipdfmx-xbb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-bmpimage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-cff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-cff_dict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-cidtype0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-cidtype2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-dpxfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-dvi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-dvipdfmx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-epdf.Po@am__quote@ @@ -1408,7 +1391,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-type0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-type1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-type1c.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-vf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xsrc/$(DEPDIR)/xdvipdfmx-xbb.Po@am__quote@ .c.o: @@ -1561,6 +1543,20 @@ dvipdfmx-dpxcrypt.obj: dpxcrypt.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dvipdfmx-dpxcrypt.obj `if test -f 'dpxcrypt.c'; then $(CYGPATH_W) 'dpxcrypt.c'; else $(CYGPATH_W) '$(srcdir)/dpxcrypt.c'; fi` +dvipdfmx-dpxfile.o: dpxfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dvipdfmx-dpxfile.o -MD -MP -MF $(DEPDIR)/dvipdfmx-dpxfile.Tpo -c -o dvipdfmx-dpxfile.o `test -f 'dpxfile.c' || echo '$(srcdir)/'`dpxfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dvipdfmx-dpxfile.Tpo $(DEPDIR)/dvipdfmx-dpxfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpxfile.c' object='dvipdfmx-dpxfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dvipdfmx-dpxfile.o `test -f 'dpxfile.c' || echo '$(srcdir)/'`dpxfile.c + +dvipdfmx-dpxfile.obj: dpxfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dvipdfmx-dpxfile.obj -MD -MP -MF $(DEPDIR)/dvipdfmx-dpxfile.Tpo -c -o dvipdfmx-dpxfile.obj `if test -f 'dpxfile.c'; then $(CYGPATH_W) 'dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/dpxfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dvipdfmx-dpxfile.Tpo $(DEPDIR)/dvipdfmx-dpxfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpxfile.c' object='dvipdfmx-dpxfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dvipdfmx-dpxfile.obj `if test -f 'dpxfile.c'; then $(CYGPATH_W) 'dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/dpxfile.c'; fi` + dvipdfmx-dpxutil.o: dpxutil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dvipdfmx-dpxutil.o -MD -MP -MF $(DEPDIR)/dvipdfmx-dpxutil.Tpo -c -o dvipdfmx-dpxutil.o `test -f 'dpxutil.c' || echo '$(srcdir)/'`dpxutil.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dvipdfmx-dpxutil.Tpo $(DEPDIR)/dvipdfmx-dpxutil.Po @@ -1827,6 +1823,20 @@ dvipdfmx-unicode.obj: unicode.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dvipdfmx-unicode.obj `if test -f 'unicode.c'; then $(CYGPATH_W) 'unicode.c'; else $(CYGPATH_W) '$(srcdir)/unicode.c'; fi` +dvipdfmx-vf.o: vf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dvipdfmx-vf.o -MD -MP -MF $(DEPDIR)/dvipdfmx-vf.Tpo -c -o dvipdfmx-vf.o `test -f 'vf.c' || echo '$(srcdir)/'`vf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dvipdfmx-vf.Tpo $(DEPDIR)/dvipdfmx-vf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vf.c' object='dvipdfmx-vf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dvipdfmx-vf.o `test -f 'vf.c' || echo '$(srcdir)/'`vf.c + +dvipdfmx-vf.obj: vf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dvipdfmx-vf.obj -MD -MP -MF $(DEPDIR)/dvipdfmx-vf.Tpo -c -o dvipdfmx-vf.obj `if test -f 'vf.c'; then $(CYGPATH_W) 'vf.c'; else $(CYGPATH_W) '$(srcdir)/vf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dvipdfmx-vf.Tpo $(DEPDIR)/dvipdfmx-vf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vf.c' object='dvipdfmx-vf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dvipdfmx-vf.obj `if test -f 'vf.c'; then $(CYGPATH_W) 'vf.c'; else $(CYGPATH_W) '$(srcdir)/vf.c'; fi` + src/dvipdfmx-bmpimage.o: src/bmpimage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/dvipdfmx-bmpimage.o -MD -MP -MF src/$(DEPDIR)/dvipdfmx-bmpimage.Tpo -c -o src/dvipdfmx-bmpimage.o `test -f 'src/bmpimage.c' || echo '$(srcdir)/'`src/bmpimage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/dvipdfmx-bmpimage.Tpo src/$(DEPDIR)/dvipdfmx-bmpimage.Po @@ -1897,20 +1907,6 @@ src/dvipdfmx-cidtype2.obj: src/cidtype2.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/dvipdfmx-cidtype2.obj `if test -f 'src/cidtype2.c'; then $(CYGPATH_W) 'src/cidtype2.c'; else $(CYGPATH_W) '$(srcdir)/src/cidtype2.c'; fi` -src/dvipdfmx-dpxfile.o: src/dpxfile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/dvipdfmx-dpxfile.o -MD -MP -MF src/$(DEPDIR)/dvipdfmx-dpxfile.Tpo -c -o src/dvipdfmx-dpxfile.o `test -f 'src/dpxfile.c' || echo '$(srcdir)/'`src/dpxfile.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/dvipdfmx-dpxfile.Tpo src/$(DEPDIR)/dvipdfmx-dpxfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/dpxfile.c' object='src/dvipdfmx-dpxfile.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/dvipdfmx-dpxfile.o `test -f 'src/dpxfile.c' || echo '$(srcdir)/'`src/dpxfile.c - -src/dvipdfmx-dpxfile.obj: src/dpxfile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/dvipdfmx-dpxfile.obj -MD -MP -MF src/$(DEPDIR)/dvipdfmx-dpxfile.Tpo -c -o src/dvipdfmx-dpxfile.obj `if test -f 'src/dpxfile.c'; then $(CYGPATH_W) 'src/dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/src/dpxfile.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/dvipdfmx-dpxfile.Tpo src/$(DEPDIR)/dvipdfmx-dpxfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/dpxfile.c' object='src/dvipdfmx-dpxfile.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/dvipdfmx-dpxfile.obj `if test -f 'src/dpxfile.c'; then $(CYGPATH_W) 'src/dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/src/dpxfile.c'; fi` - src/dvipdfmx-dvi.o: src/dvi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/dvipdfmx-dvi.o -MD -MP -MF src/$(DEPDIR)/dvipdfmx-dvi.Tpo -c -o src/dvipdfmx-dvi.o `test -f 'src/dvi.c' || echo '$(srcdir)/'`src/dvi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/dvipdfmx-dvi.Tpo src/$(DEPDIR)/dvipdfmx-dvi.Po @@ -2387,20 +2383,6 @@ src/dvipdfmx-type1c.obj: src/type1c.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/dvipdfmx-type1c.obj `if test -f 'src/type1c.c'; then $(CYGPATH_W) 'src/type1c.c'; else $(CYGPATH_W) '$(srcdir)/src/type1c.c'; fi` -src/dvipdfmx-vf.o: src/vf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/dvipdfmx-vf.o -MD -MP -MF src/$(DEPDIR)/dvipdfmx-vf.Tpo -c -o src/dvipdfmx-vf.o `test -f 'src/vf.c' || echo '$(srcdir)/'`src/vf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/dvipdfmx-vf.Tpo src/$(DEPDIR)/dvipdfmx-vf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/vf.c' object='src/dvipdfmx-vf.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/dvipdfmx-vf.o `test -f 'src/vf.c' || echo '$(srcdir)/'`src/vf.c - -src/dvipdfmx-vf.obj: src/vf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/dvipdfmx-vf.obj -MD -MP -MF src/$(DEPDIR)/dvipdfmx-vf.Tpo -c -o src/dvipdfmx-vf.obj `if test -f 'src/vf.c'; then $(CYGPATH_W) 'src/vf.c'; else $(CYGPATH_W) '$(srcdir)/src/vf.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/dvipdfmx-vf.Tpo src/$(DEPDIR)/dvipdfmx-vf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/vf.c' object='src/dvipdfmx-vf.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/dvipdfmx-vf.obj `if test -f 'src/vf.c'; then $(CYGPATH_W) 'src/vf.c'; else $(CYGPATH_W) '$(srcdir)/src/vf.c'; fi` - src/dvipdfmx-xbb.o: src/xbb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/dvipdfmx-xbb.o -MD -MP -MF src/$(DEPDIR)/dvipdfmx-xbb.Tpo -c -o src/dvipdfmx-xbb.o `test -f 'src/xbb.c' || echo '$(srcdir)/'`src/xbb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/dvipdfmx-xbb.Tpo src/$(DEPDIR)/dvipdfmx-xbb.Po @@ -2527,6 +2509,20 @@ xdvipdfmx-dpxcrypt.obj: dpxcrypt.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdvipdfmx-dpxcrypt.obj `if test -f 'dpxcrypt.c'; then $(CYGPATH_W) 'dpxcrypt.c'; else $(CYGPATH_W) '$(srcdir)/dpxcrypt.c'; fi` +xdvipdfmx-dpxfile.o: dpxfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdvipdfmx-dpxfile.o -MD -MP -MF $(DEPDIR)/xdvipdfmx-dpxfile.Tpo -c -o xdvipdfmx-dpxfile.o `test -f 'dpxfile.c' || echo '$(srcdir)/'`dpxfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xdvipdfmx-dpxfile.Tpo $(DEPDIR)/xdvipdfmx-dpxfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpxfile.c' object='xdvipdfmx-dpxfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdvipdfmx-dpxfile.o `test -f 'dpxfile.c' || echo '$(srcdir)/'`dpxfile.c + +xdvipdfmx-dpxfile.obj: dpxfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdvipdfmx-dpxfile.obj -MD -MP -MF $(DEPDIR)/xdvipdfmx-dpxfile.Tpo -c -o xdvipdfmx-dpxfile.obj `if test -f 'dpxfile.c'; then $(CYGPATH_W) 'dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/dpxfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xdvipdfmx-dpxfile.Tpo $(DEPDIR)/xdvipdfmx-dpxfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpxfile.c' object='xdvipdfmx-dpxfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdvipdfmx-dpxfile.obj `if test -f 'dpxfile.c'; then $(CYGPATH_W) 'dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/dpxfile.c'; fi` + xdvipdfmx-dpxutil.o: dpxutil.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdvipdfmx-dpxutil.o -MD -MP -MF $(DEPDIR)/xdvipdfmx-dpxutil.Tpo -c -o xdvipdfmx-dpxutil.o `test -f 'dpxutil.c' || echo '$(srcdir)/'`dpxutil.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xdvipdfmx-dpxutil.Tpo $(DEPDIR)/xdvipdfmx-dpxutil.Po @@ -2793,6 +2789,20 @@ xdvipdfmx-unicode.obj: unicode.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdvipdfmx-unicode.obj `if test -f 'unicode.c'; then $(CYGPATH_W) 'unicode.c'; else $(CYGPATH_W) '$(srcdir)/unicode.c'; fi` +xdvipdfmx-vf.o: vf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdvipdfmx-vf.o -MD -MP -MF $(DEPDIR)/xdvipdfmx-vf.Tpo -c -o xdvipdfmx-vf.o `test -f 'vf.c' || echo '$(srcdir)/'`vf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xdvipdfmx-vf.Tpo $(DEPDIR)/xdvipdfmx-vf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vf.c' object='xdvipdfmx-vf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdvipdfmx-vf.o `test -f 'vf.c' || echo '$(srcdir)/'`vf.c + +xdvipdfmx-vf.obj: vf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdvipdfmx-vf.obj -MD -MP -MF $(DEPDIR)/xdvipdfmx-vf.Tpo -c -o xdvipdfmx-vf.obj `if test -f 'vf.c'; then $(CYGPATH_W) 'vf.c'; else $(CYGPATH_W) '$(srcdir)/vf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xdvipdfmx-vf.Tpo $(DEPDIR)/xdvipdfmx-vf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='vf.c' object='xdvipdfmx-vf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdvipdfmx-vf.obj `if test -f 'vf.c'; then $(CYGPATH_W) 'vf.c'; else $(CYGPATH_W) '$(srcdir)/vf.c'; fi` + xsrc/xdvipdfmx-bmpimage.o: xsrc/bmpimage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsrc/xdvipdfmx-bmpimage.o -MD -MP -MF xsrc/$(DEPDIR)/xdvipdfmx-bmpimage.Tpo -c -o xsrc/xdvipdfmx-bmpimage.o `test -f 'xsrc/bmpimage.c' || echo '$(srcdir)/'`xsrc/bmpimage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xsrc/$(DEPDIR)/xdvipdfmx-bmpimage.Tpo xsrc/$(DEPDIR)/xdvipdfmx-bmpimage.Po @@ -2863,20 +2873,6 @@ xsrc/xdvipdfmx-cidtype2.obj: xsrc/cidtype2.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xsrc/xdvipdfmx-cidtype2.obj `if test -f 'xsrc/cidtype2.c'; then $(CYGPATH_W) 'xsrc/cidtype2.c'; else $(CYGPATH_W) '$(srcdir)/xsrc/cidtype2.c'; fi` -xsrc/xdvipdfmx-dpxfile.o: xsrc/dpxfile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsrc/xdvipdfmx-dpxfile.o -MD -MP -MF xsrc/$(DEPDIR)/xdvipdfmx-dpxfile.Tpo -c -o xsrc/xdvipdfmx-dpxfile.o `test -f 'xsrc/dpxfile.c' || echo '$(srcdir)/'`xsrc/dpxfile.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xsrc/$(DEPDIR)/xdvipdfmx-dpxfile.Tpo xsrc/$(DEPDIR)/xdvipdfmx-dpxfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xsrc/dpxfile.c' object='xsrc/xdvipdfmx-dpxfile.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xsrc/xdvipdfmx-dpxfile.o `test -f 'xsrc/dpxfile.c' || echo '$(srcdir)/'`xsrc/dpxfile.c - -xsrc/xdvipdfmx-dpxfile.obj: xsrc/dpxfile.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsrc/xdvipdfmx-dpxfile.obj -MD -MP -MF xsrc/$(DEPDIR)/xdvipdfmx-dpxfile.Tpo -c -o xsrc/xdvipdfmx-dpxfile.obj `if test -f 'xsrc/dpxfile.c'; then $(CYGPATH_W) 'xsrc/dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/xsrc/dpxfile.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xsrc/$(DEPDIR)/xdvipdfmx-dpxfile.Tpo xsrc/$(DEPDIR)/xdvipdfmx-dpxfile.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xsrc/dpxfile.c' object='xsrc/xdvipdfmx-dpxfile.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xsrc/xdvipdfmx-dpxfile.obj `if test -f 'xsrc/dpxfile.c'; then $(CYGPATH_W) 'xsrc/dpxfile.c'; else $(CYGPATH_W) '$(srcdir)/xsrc/dpxfile.c'; fi` - xsrc/xdvipdfmx-dvi.o: xsrc/dvi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsrc/xdvipdfmx-dvi.o -MD -MP -MF xsrc/$(DEPDIR)/xdvipdfmx-dvi.Tpo -c -o xsrc/xdvipdfmx-dvi.o `test -f 'xsrc/dvi.c' || echo '$(srcdir)/'`xsrc/dvi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xsrc/$(DEPDIR)/xdvipdfmx-dvi.Tpo xsrc/$(DEPDIR)/xdvipdfmx-dvi.Po @@ -3367,20 +3363,6 @@ xsrc/xdvipdfmx-type1c.obj: xsrc/type1c.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xsrc/xdvipdfmx-type1c.obj `if test -f 'xsrc/type1c.c'; then $(CYGPATH_W) 'xsrc/type1c.c'; else $(CYGPATH_W) '$(srcdir)/xsrc/type1c.c'; fi` -xsrc/xdvipdfmx-vf.o: xsrc/vf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsrc/xdvipdfmx-vf.o -MD -MP -MF xsrc/$(DEPDIR)/xdvipdfmx-vf.Tpo -c -o xsrc/xdvipdfmx-vf.o `test -f 'xsrc/vf.c' || echo '$(srcdir)/'`xsrc/vf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xsrc/$(DEPDIR)/xdvipdfmx-vf.Tpo xsrc/$(DEPDIR)/xdvipdfmx-vf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xsrc/vf.c' object='xsrc/xdvipdfmx-vf.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xsrc/xdvipdfmx-vf.o `test -f 'xsrc/vf.c' || echo '$(srcdir)/'`xsrc/vf.c - -xsrc/xdvipdfmx-vf.obj: xsrc/vf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsrc/xdvipdfmx-vf.obj -MD -MP -MF xsrc/$(DEPDIR)/xdvipdfmx-vf.Tpo -c -o xsrc/xdvipdfmx-vf.obj `if test -f 'xsrc/vf.c'; then $(CYGPATH_W) 'xsrc/vf.c'; else $(CYGPATH_W) '$(srcdir)/xsrc/vf.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xsrc/$(DEPDIR)/xdvipdfmx-vf.Tpo xsrc/$(DEPDIR)/xdvipdfmx-vf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xsrc/vf.c' object='xsrc/xdvipdfmx-vf.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xsrc/xdvipdfmx-vf.obj `if test -f 'xsrc/vf.c'; then $(CYGPATH_W) 'xsrc/vf.c'; else $(CYGPATH_W) '$(srcdir)/xsrc/vf.c'; fi` - xsrc/xdvipdfmx-xbb.o: xsrc/xbb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xdvipdfmx_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xsrc/xdvipdfmx-xbb.o -MD -MP -MF xsrc/$(DEPDIR)/xdvipdfmx-xbb.Tpo -c -o xsrc/xdvipdfmx-xbb.o `test -f 'xsrc/xbb.c' || echo '$(srcdir)/'`xsrc/xbb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xsrc/$(DEPDIR)/xdvipdfmx-xbb.Tpo xsrc/$(DEPDIR)/xdvipdfmx-xbb.Po diff --git a/Build/source/texk/dvipdfm-x/dpxfile.c b/Build/source/texk/dvipdfm-x/dpxfile.c new file mode 100644 index 00000000000..804ed70774d --- /dev/null +++ b/Build/source/texk/dvipdfm-x/dpxfile.c @@ -0,0 +1,1178 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + Copyright (C) 1998, 1999 by Mark A. Wicks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef _MSC_VER +#include +#endif + +#include + +#include "system.h" +#include "error.h" +#include "mem.h" + +#include "dpxutil.h" +#include "mfileio.h" + +#include "dpxfile.h" +#include "dpxcrypt.h" +#define MAX_KEY_LEN 16 + +#include +#include +#ifdef WIN32 +#include +#include +#else +#if HAVE_SYS_WAIT_H +#include +#endif +#ifndef WEXITSTATUS +#define WEXITSTATUS(val) ((unsigned)(val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(val) (((val) & 255) == 0) +#endif +#endif + +static int verbose = 0; +int keep_cache = 0; + +void +dpx_file_set_verbose (void) +{ + verbose++; +} + + +/* Kpathsea library does not check file type. */ +static int qcheck_filetype (const char *fqpn, int type); + +/* For testing MIKTEX enabled compilation */ +#if defined(TESTCOMPILE) && !defined(MIKTEX) +# define MIKTEX 1 +# define PATH_SEP_CHR '/' +# define _MAX_PATH 256 + +static int +miktex_get_acrobat_font_dir (char *buf) +{ + strcpy(buf, "/usr/share/ghostscript/Resource/Font/"); + return 1; +} + +static int +miktex_find_file (const char *filename, const char *dirlist, char *buf) +{ + int r = 0; + char *fqpn; + + fqpn = kpse_path_search(dirlist, filename, 0); + if (!fqpn) + return 0; + if (strlen(fqpn) > _MAX_PATH) + r = 0; + else { + strcpy(buf, fqpn); + r = 1; + } + RELEASE(fqpn); + + return r; +} + +static int +miktex_find_app_input_file (const char *progname, const char *filename, char *buf) +{ + int r = 0; + char *fqpn; + + kpse_reset_program_name(progname); + fqpn = kpse_find_file (filename, kpse_program_text_format, false); + kpse_reset_program_name(PACKAGE); + + if (!fqpn) + return 0; + if (strlen(fqpn) > _MAX_PATH) + r = 0; + else { + strcpy(buf, fqpn); + r = 1; + } + RELEASE(fqpn); + + return r; +} + +static int +miktex_find_psheader_file (const char *filename, char *buf) +{ + int r; + char *fqpn; + + fqpn = kpse_find_file(filename, kpse_tex_ps_header_format, 0); + + if (!fqpn) + return 0; + if (strlen(fqpn) > _MAX_PATH) + r = 0; + else { + strcpy(buf, fqpn); + r = 1; + } + RELEASE(fqpn); + + return r; +} + +#endif /* TESTCOMPILE */ + +#ifdef MIKTEX +#ifndef PATH_SEP_CHR +# define PATH_SEP_CHR '\\' +#endif +static char _tmpbuf[_MAX_PATH+1]; +#endif /* MIKTEX */ + +static int exec_spawn (char *cmd) +{ + char **cmdv, **qv; + char *p, *pp; + char buf[1024]; + int i, ret = -1; + + if (!cmd) + return -1; + while (*cmd == ' ' || *cmd == '\t') + cmd++; + if (*cmd == '\0') + return -1; + i = 0; + p = cmd; + while (*p) { + if (*p == ' ' || *p == '\t') + i++; + p++; + } + cmdv = xcalloc (i + 2, sizeof (char *)); + p = cmd; + qv = cmdv; + while (*p) { + pp = buf; + if (*p == '"') { + p++; + while (*p != '"') { + if (*p == '\0') { + goto done; + } + *pp++ = *p++; + } + p++; + } else if (*p == '\'') { + p++; + while (*p != '\'') { + if (*p == '\0') { + goto done; + } + *pp++ = *p++; + } + p++; + } else { + while (*p != ' ' && *p != '\t' && *p) { + if (*p == '\'') { + p++; + while (*p != '\'') { + if (*p == '\0') { + goto done; + } + *pp++ = *p++; + } + p++; + } else { + *pp++ = *p++; + } + } + } + *pp = '\0'; +#ifdef WIN32 + if (strchr (buf, ' ') || strchr (buf, '\t')) + *qv = concat3 ("\"", buf, "\""); + else +#endif + *qv = xstrdup (buf); +/* + fprintf(stderr,"\n%s", *qv); +*/ + while (*p == ' ' || *p == '\t') + p++; + qv++; + } +#ifdef WIN32 + ret = spawnvp (_P_WAIT, *cmdv, (const char* const*) cmdv); +#else + i = fork (); + if (i < 0) + ret = -1; + else if (i == 0) { + if (execvp (*cmdv, cmdv)) + _exit (-1); + } else { + if (wait (&ret) == i) { + ret = (WIFEXITED (ret) ? WEXITSTATUS (ret) : -1); + } else { + ret = -1; + } + } +#endif +done: + qv = cmdv; + while (*qv) { + free (*qv); + qv++; + } + free (cmdv); + return ret; +} + +/* ensuresuffix() returns a copy of basename if sfx is "". */ +static char * +ensuresuffix (const char *basename, const char *sfx) +{ + char *q, *p; + + p = NEW(strlen(basename) + strlen(sfx) + 1, char); + strcpy(p, basename); + q = strrchr(p, '.'); + if (!q && sfx[0]) + strcat(p, sfx); + + return p; +} + +#ifdef MIKTEX +static char * +dpx_find__app__xyz (const char *filename, + const char *suffix, int is_text) +{ + char *fqpn = NULL; + int r; + char *q; + + q = ensuresuffix(filename, suffix); + r = miktex_find_app_input_file(PACKAGE, q, _tmpbuf); + if (!r && strcmp(q, filename)) + r = miktex_find_app_input_file(PACKAGE, filename, _tmpbuf); + if (r) { + fqpn = NEW(strlen(_tmpbuf) + 1, char); + strcpy(fqpn, _tmpbuf); + } + RELEASE(q); + + return fqpn; +} + +static char * +dpx_foolsearch (const char *foolname, + const char *filename, + int is_text) +{ + char *fqpn = NULL; + int r; + + r = miktex_find_app_input_file(foolname, filename, _tmpbuf); + if (r) { + fqpn = NEW(strlen(_tmpbuf) + 1, char); + strcpy(fqpn, _tmpbuf); + } + + return fqpn; +} +#else /* !MIKTEX */ +# define TDS11DOC "http://www.tug.org/ftp/tex/tds-1.1/tds.html#Fonts" +static void +insistupdate (const char *filename, + const char *fqpn, + const char *foolname, + kpse_file_format_type foolformat, + kpse_file_format_type realformat) +{ + kpse_format_info_type *fif; + kpse_format_info_type *fir; + if (verbose < 1) + return; + fif = &kpse_format_info[foolformat]; + fir = &kpse_format_info[realformat]; + WARN("File name=\"%s\" format=\"%s\" might be found in different location than I expected:", + filename, fir->type); + WARN(">> %s", fqpn); + WARN(">> Please adjust your TEXMF as conformant with:"); + WARN(">> " TDS11DOC); + WARN(">> I searched it with fooling kpathsea as progname=\"%s\" format=\"%s\".", + foolname, fif->type); + WARN(">> Default search path for this format file is:"); + WARN(">> %s", fir->default_path); + WARN(">> Please read \"README\" file."); +} + +static char * +dpx_find__app__xyz (const char *filename, + const char *suffix, int is_text) +{ + char *fqpn = NULL; + char *q; + + q = ensuresuffix(filename, suffix); + fqpn = kpse_find_file(q, + (is_text ? + kpse_program_text_format : kpse_program_binary_format), 0); + if (!fqpn && strcmp(q, filename)) + fqpn = kpse_find_file(filename, + (is_text ? + kpse_program_text_format : kpse_program_binary_format), 0); + RELEASE(q); + + return fqpn; +} + +static char * +dpx_foolsearch (const char *foolname, + const char *filename, + int is_text) +{ + char *fqpn = NULL; + + kpse_reset_program_name(foolname); + fqpn = kpse_find_file (filename, + (is_text ? + kpse_program_text_format : + kpse_program_binary_format), + false); + kpse_reset_program_name(PACKAGE); + + return fqpn; +} +#endif /* MIKTEX */ + +static char *dpx_find_fontmap_file (const char *filename); +static char *dpx_find_agl_file (const char *filename); +static char *dpx_find_sfd_file (const char *filename); +static char *dpx_find_cmap_file (const char *filename); +static char *dpx_find_enc_file (const char *filename); +static char *dpx_find_iccp_file (const char *filename); + +FILE * +dpx_open_file (const char *filename, int type) +{ + FILE *fp = NULL; + char *fqpn = NULL; + + switch (type) { + case DPX_RES_TYPE_FONTMAP: + fqpn = dpx_find_fontmap_file(filename); + break; + case DPX_RES_TYPE_T1FONT: + fqpn = dpx_find_type1_file(filename); + break; + case DPX_RES_TYPE_TTFONT: + fqpn = dpx_find_truetype_file(filename); + break; + case DPX_RES_TYPE_OTFONT: + fqpn = dpx_find_opentype_file(filename); + break; + case DPX_RES_TYPE_PKFONT: + break; + case DPX_RES_TYPE_CMAP: + fqpn = dpx_find_cmap_file(filename); + break; + case DPX_RES_TYPE_ENC: + fqpn = dpx_find_enc_file(filename); + break; + case DPX_RES_TYPE_SFD: + fqpn = dpx_find_sfd_file(filename); + break; + case DPX_RES_TYPE_AGL: + fqpn = dpx_find_agl_file(filename); + break; + case DPX_RES_TYPE_ICCPROFILE: + fqpn = dpx_find_iccp_file(filename); + break; + case DPX_RES_TYPE_DFONT: + fqpn = dpx_find_dfont_file(filename); + break; + case DPX_RES_TYPE_BINARY: + fqpn = dpx_find__app__xyz(filename, "", 0); + break; + case DPX_RES_TYPE_TEXT: + fqpn = dpx_find__app__xyz(filename, "", 1); + break; + default: + ERROR("Unknown resource type: %d", type); + break; + } + if (fqpn) { + fp = MFOPEN(fqpn, FOPEN_RBIN_MODE); + RELEASE(fqpn); + } + + return fp; +} + + +static char * +dpx_find_iccp_file (const char *filename) +{ + char *fqpn = NULL; + + fqpn = dpx_find__app__xyz(filename, "", 0); + if (fqpn || strrchr(filename, '.')) + return fqpn; + + fqpn = dpx_find__app__xyz(filename, ".icc", 0); + if (fqpn) + return fqpn; + + fqpn = dpx_find__app__xyz(filename, ".icm", 0); + + return fqpn; +} + + +static char * +dpx_find_fontmap_file (const char *filename) +{ + char *fqpn = NULL; + char *q; + + q = ensuresuffix(filename, ".map"); +#ifdef MIKTEX + fqpn = dpx_find__app__xyz(q, ".map", 1); +#else /* !MIKTEX */ + fqpn = kpse_find_file(q, kpse_fontmap_format, 0); + if (!fqpn) { + fqpn = dpx_find__app__xyz(q, ".map", 1); + if (fqpn) + insistupdate(q, fqpn, PACKAGE, + kpse_program_text_format, kpse_fontmap_format); + } +#endif /* MIKETEX */ + RELEASE(q); + + return fqpn; +} + + +static char * +dpx_find_agl_file (const char *filename) +{ + char *fqpn = NULL; + char *q; + + q = ensuresuffix(filename, ".txt"); +#ifdef MIKTEX + fqpn = dpx_find__app__xyz(q, ".txt", 1); +#else /* !MIKTEX */ + fqpn = kpse_find_file(q, kpse_fontmap_format, 0); + if (!fqpn) { + fqpn = dpx_find__app__xyz(q, ".txt", 1); + if (fqpn) + insistupdate(q, fqpn, PACKAGE, + kpse_program_text_format, kpse_fontmap_format); + } +#endif /* MIKETEX */ + RELEASE(q); + + return fqpn; +} + + +/* cmap.sty put files into tex/latex/cmap */ +static char * +dpx_find_cmap_file (const char *filename) +{ + char *fqpn = NULL; + static const char *fools[] = { + "cmap", "tex", NULL + }; + int i; + +#if defined(MIKTEX) + /* Find in Acrobat's Resource/CMap dir */ + { + char _acrodir[_MAX_PATH+1]; + char *q; + int r; + + memset(_acrodir, 0, _MAX_PATH+1); + r = miktex_get_acrobat_font_dir(_acrodir); + if (r && + strlen(_acrodir) > strlen("Font")) { + /* ....\Font\ */ + q = strrchr(_acrodir, PATH_SEP_CHR); + if (q && q[1] == '\0') + q[0] = '\0'; + q = strrchr(_acrodir, PATH_SEP_CHR); + if (q && !strcmp(q + 1, "Font")) { + sprintf(q, "%cCMap%c", PATH_SEP_CHR, PATH_SEP_CHR); + r = miktex_find_file(filename, _acrodir, _tmpbuf); + if (r) { + fqpn = NEW(strlen(_tmpbuf) + 1, char); + strcpy(fqpn, _tmpbuf); + } + } + } + memset(_tmpbuf, 0, _MAX_PATH+1); + } +#else + fqpn = kpse_find_file(filename, kpse_cmap_format, 0); +#endif + + /* Files found above are assumed to be CMap, + * if it's not really CMap it will cause an error. + */ + for (i = 0; !fqpn && fools[i]; i++) { + fqpn = dpx_foolsearch(fools[i], filename, 1); + if (fqpn) { +#ifndef MIKTEX + insistupdate(filename, fqpn, fools[i], + kpse_program_text_format, kpse_cmap_format); +#endif + if (!qcheck_filetype(fqpn, DPX_RES_TYPE_CMAP)) { + WARN("Found file \"%s\" for PostScript CMap but it doesn't look like a CMap...", fqpn); + RELEASE(fqpn); + fqpn = NULL; + } + } + } + + return fqpn; +} + + +/* Search order: + * SFDFONTS (TDS 1.1) + * ttf2pk (text file) + * ttf2tfm (text file) + * dvipdfm (text file) + */ +static char * +dpx_find_sfd_file (const char *filename) +{ + char *fqpn = NULL; + char *q; + static const char *fools[] = { + "ttf2pk", "ttf2tfm", NULL + }; + int i; + + q = ensuresuffix(filename, ".sfd"); +#ifndef MIKTEX + fqpn = kpse_find_file(q, kpse_sfd_format, 0); +#endif /* !MIKTEX */ + + for (i = 0; !fqpn && fools[i]; i++) { + fqpn = dpx_foolsearch(fools[i], q, 1); +#ifndef MIKTEX + if (fqpn) + insistupdate(filename, fqpn, fools[i], + kpse_program_text_format, kpse_sfd_format); +#endif + } + RELEASE(q); + + return fqpn; +} + + +static char * +dpx_find_enc_file (const char *filename) +{ + char *fqpn = NULL; + char *q; + static const char *fools[] = { + "dvips", NULL + }; + int i; + + q = ensuresuffix(filename, ".enc"); +#ifdef MIKTEX + if (miktex_find_psheader_file(q, _tmpbuf)) { + fqpn = NEW(strlen(_tmpbuf) + 1, char); + strcpy(fqpn, _tmpbuf); + } +#else + fqpn = kpse_find_file(q, kpse_enc_format, 0); +#endif /* MIKTEX */ + + for (i = 0; !fqpn && fools[i]; i++) { + fqpn = dpx_foolsearch(fools[i], q, 1); +#ifndef MIKTEX + if (fqpn) + insistupdate(filename, fqpn, fools[i], + kpse_program_text_format, kpse_enc_format); +#endif + } + RELEASE(q); + + return fqpn; +} + +static int +is_absolute_path(const char *filename) +{ +#ifdef WIN32 + if (isalpha(filename[0]) && filename[1] == ':') + return 1; + if (filename[0] == '\\' && filename[1] == '\\') + return 1; + if (filename[0] == '/' && filename[1] == '/') + return 1; +#else + if (filename[0] == '/') + return 1; +#endif + return 0; +} + +char * +dpx_find_type1_file (const char *filename) +{ + char *fqpn = NULL; + + if (is_absolute_path(filename)) + fqpn = xstrdup(filename); + else + fqpn = kpse_find_file(filename, kpse_type1_format, 0); + if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_T1FONT)) { + RELEASE(fqpn); + fqpn = NULL; + } + + return fqpn; +} + + +char * +dpx_find_truetype_file (const char *filename) +{ + char *fqpn = NULL; + + if (is_absolute_path(filename)) + fqpn = xstrdup(filename); + else + fqpn = kpse_find_file(filename, kpse_truetype_format, 0); + if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_TTFONT)) { + RELEASE(fqpn); + fqpn = NULL; + } + + return fqpn; +} + + +char * +dpx_find_opentype_file (const char *filename) +{ + char *fqpn = NULL; + char *q; + + q = ensuresuffix(filename, ".otf"); +#ifndef MIKTEX + if (is_absolute_path(q)) + fqpn = xstrdup(q); + else + fqpn = kpse_find_file(q, kpse_opentype_format, 0); + if (!fqpn) { +#endif + fqpn = dpx_foolsearch(PACKAGE, q, 0); +#ifndef MIKTEX + if (fqpn) + insistupdate(filename, fqpn, PACKAGE, + kpse_program_binary_format, kpse_opentype_format); + } +#endif + RELEASE(q); + + /* *We* use "opentype" for ".otf" (CFF). */ + if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_OTFONT)) { + RELEASE(fqpn); + fqpn = NULL; + } + + return fqpn; +} + + +char * +dpx_find_dfont_file (const char *filename) +{ + char *fqpn = NULL; + + fqpn = kpse_find_file(filename, kpse_truetype_format, 0); + if (fqpn) { + int len = strlen(fqpn); + if (len > 6 && strncmp(fqpn+len-6, ".dfont", 6)) { + fqpn = RENEW(fqpn, len+6, char); + strcat(fqpn, "/rsrc"); + } + } + if (!qcheck_filetype(fqpn, DPX_RES_TYPE_DFONT)) { + RELEASE(fqpn); + fqpn = NULL; + } + return fqpn; +} + +static const char * +dpx_get_tmpdir (void) +{ +# ifdef WIN32 +# define __TMPDIR "." +# else /* WIN32 */ +# define __TMPDIR "/tmp" +#endif /* WIN32 */ + const char *_tmpd; + +# ifdef HAVE_GETENV + _tmpd = getenv("TMPDIR"); +# ifdef WIN32 + if (!_tmpd) + _tmpd = getenv("TMP"); + if (!_tmpd) + _tmpd = getenv("TEMP"); +# endif /* WIN32 */ + if (!_tmpd) + _tmpd = __TMPDIR; +# else /* HAVE_GETENV */ + _tmpd = __TMPDIR; +# endif /* HAVE_GETENV */ + return _tmpd; +} + +#ifdef HAVE_MKSTEMP +# include +#endif + +#ifdef XETEX +char * +dpx_create_temp_file (void) +{ + char *tmp = NULL; + +#if defined(MIKTEX) + { + tmp = NEW(_MAX_PATH + 1, char); + miktex_create_temp_file_name(tmp); /* FIXME_FIXME */ + } +#elif defined(HAVE_MKSTEMP) +# define TEMPLATE "/dvipdfmx.XXXXXX" + { + const char *_tmpd; + int _fd = -1; + _tmpd = dpx_get_tmpdir(); + tmp = NEW(strlen(_tmpd) + strlen(TEMPLATE) + 1, char); + strcpy(tmp, _tmpd); + strcat(tmp, TEMPLATE); + _fd = mkstemp(tmp); + if (_fd != -1) +#ifdef WIN32 + _close(_fd); +#else + close(_fd); +#endif /* WIN32 */ + else { + RELEASE(tmp); + tmp = NULL; + } + } +#else /* use _tempnam or tmpnam */ + { +# ifdef WIN32 + const char *_tmpd; + char *p; + _tmpd = dpx_get_tmpdir(); + tmp = _tempnam (_tmpd, "dvipdfmx."); + for (p = tmp; *p; p++) { + if (IS_KANJI (p)) + p++; + else if (*p == '\\') + *p = '/'; + } +# else /* WIN32 */ + char *_tmpa = NEW(L_tmpnam + 1, char); + tmp = tmpnam(_tmpa); + if (!tmp) + RELEASE(_tmpa); +# endif /* WIN32 */ + } +#endif /* MIKTEX */ + + return tmp; +} +#endif /* XETEX */ + +char * +dpx_create_fix_temp_file (const char *filename) +{ +#ifdef XETEX +#define PREFIX "xdvipdfmx." +#else +#define PREFIX "dvipdfmx." +#endif + static const char *dir = NULL; + static char *cwd = NULL; + char *ret, *s; + int i; + MD5_CONTEXT state; + unsigned char digest[MAX_KEY_LEN]; +#ifdef WIN32 + char *p; +#endif + + if (!dir) { + dir = dpx_get_tmpdir(); + cwd = xgetcwd(); + } + + MD5_init(&state); + MD5_write(&state, (unsigned char *)cwd, strlen(cwd)); + MD5_write(&state, (unsigned const char *)filename, strlen(filename)); + MD5_final(digest, &state); + + ret = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); + sprintf(ret, "%s/%s", dir, PREFIX); + s = ret + strlen(ret); + for (i=0; id_name) != plen + MAX_KEY_LEN * 2) return 0; +#ifdef WIN32 + return strncasecmp(ent->d_name, PREFIX, plen) == 0; +#else + return strncmp(ent->d_name, PREFIX, plen) == 0; +#endif +} + +void +dpx_delete_old_cache (int life) +{ + const char *dir; + char *pathname; + DIR *dp; + struct dirent *de; + time_t limit; + + if (life == -2) { + keep_cache = -1; + return; + } + + dir = dpx_get_tmpdir(); + pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); + limit = time(NULL) - life * 60 * 60; + + if (life >= 0) keep_cache = 1; + if ((dp = opendir(dir)) != NULL) { + while((de = readdir(dp)) != NULL) { + if (dpx_clear_cache_filter(de)) { + struct stat sb; + sprintf(pathname, "%s/%s", dir, de->d_name); + stat(pathname, &sb); + if (sb.st_mtime < limit) { + remove(pathname); + /* printf("remove: %s\n", pathname); */ + } + } + } + closedir(dp); + } + RELEASE(pathname); +} + +void +dpx_delete_temp_file (char *tmp, int force) +{ + if (!tmp) + return; + if (force || keep_cache != 1) remove (tmp); + RELEASE(tmp); + + return; +} + +/* dpx_file_apply_filter() is used for converting unsupported graphics + * format to one of the formats that dvipdfmx can natively handle. + * 'input' is the filename of the original file and 'output' is actually + * temporal files 'generated' by the above routine. + * This should be system dependent. (MiKTeX may want something different) + * Please modify as appropriate (see also pdfximage.c and dvipdfmx.c). + */ +int +dpx_file_apply_filter (const char *cmdtmpl, + const char *input, const char *output, + unsigned char version) +{ + char *cmd = NULL; + const char *p, *q; + size_t n, size; + int error = 0; + + if (!cmdtmpl) + return -1; + else if (!input || !output) + return -1; + + size = strlen(cmdtmpl) + strlen(input) + strlen(output) + 3; + cmd = NEW(size, char); + memset(cmd, 0, size); + for (n = 0, p = cmdtmpl; *p != 0; p++) { +#define need(s,l,m,n) \ +if ((l) + (n) >= (m)) { \ + (m) += (n) + 128; \ + (s) = RENEW((s), (m), char); \ +} + if (p[0] == '%') { + p++; + switch (p[0]) { + case 'o': /* Output file name */ + need(cmd, n, size, strlen(output)); + strcpy(cmd + n, output); n += strlen(output); + break; + case 'i': /* Input filename */ + need(cmd, n, size, strlen(input)); + strcpy(cmd + n, input); n += strlen(input); + break; + case 'b': + need(cmd, n, size, strlen(input)); + q = strrchr(input, '.'); /* wrong */ + if (q) { + memcpy(cmd + n, input, (int) (q - input)); + n += (int) (q - input); + } else { + strcpy(cmd + n, input); n += strlen(input); + } + case 'v': /* Version number, e.g. 1.4 */ { + char buf[6]; + sprintf(buf, "1.%hu", (unsigned short) version); + need(cmd, n, size, strlen(buf)); + strcpy(cmd + n, buf); n += strlen(buf); + break; + } + case 0: + break; + case '%': + need(cmd, n, size, 1); + cmd[n] = '%'; n++; + break; + } + } else { + need(cmd, n, size, 1); + cmd[n] = p[0]; n++; + } + } + need(cmd, n, size, 1); + cmd[n] = '\0'; + if (strlen(cmd) == 0) { + RELEASE(cmd); + return -1; + } + + error = exec_spawn(cmd); + if (error) + WARN("Filtering file via command -->%s<-- failed.", cmd); + RELEASE(cmd); + + return error; +} + +static char _sbuf[128]; +/* + * SFNT type sigs: + * `true' (0x74727565): TrueType (Mac) + * `typ1' (0x74797031) (Mac): PostScript font housed in a sfnt wrapper + * 0x00010000: TrueType (Win)/OpenType + * `OTTO': PostScript CFF font with OpenType wrapper + * `ttcf': TrueType Collection + */ +static int +istruetype (FILE *fp) +{ + int n; + + rewind(fp); + n = fread(_sbuf, 1, 4, fp); + rewind(fp); + + if (n != 4) + return 0; + else if (!memcmp(_sbuf, "true", 4) || + !memcmp(_sbuf, "\0\1\0\0", 4)) /* This doesn't help... */ + return 1; + else if (!memcmp(_sbuf, "ttcf", 4)) + return 1; + + return 0; +} + +/* "OpenType" is only for ".otf" here */ +static int +isopentype (FILE *fp) +{ + int n; + + rewind(fp); + n = fread(_sbuf, 1, 4, fp); + rewind(fp); + + if (n != 4) + return 0; + else if (!memcmp(_sbuf, "OTTO", 4)) + return 1; + else + return 0; +} + +static int +ist1binary (FILE *fp) +{ + char *p; + int n; + + rewind(fp); + n = fread(_sbuf, 1, 21, fp); + rewind(fp); + + p = _sbuf; + if (n != 21) + return 0; + else if (p[0] != (char) 0x80 || p[1] < 0 || p[1] > 3) + return 0; + else if (!memcmp(p + 6, "%!PS-AdobeFont", 14) || + !memcmp(p + 6, "%!FontType1", 11)) + return 1; + else if (!memcmp(p + 6, "%!PS", 4)) { +#if 0 + p[20] = '\0'; p += 6; + WARN("Ambiguous PostScript resource type: %s", (char *) p); +#endif + return 1; + } + /* Otherwise ambiguious */ + return 0; +} + +/* %!PS-Adobe-x.y Resource-CMap */ +static int +ispscmap (FILE *fp) +{ + char *p; + p = mfgets(_sbuf, 128, fp); p[127] = '\0'; + if (!p || strlen(p) < 4 || memcmp(p, "%!PS", 4)) + return 0; + for (p += 4; *p && !isspace(*p); p++); + for ( ; *p && (*p == ' ' || *p == '\t'); p++); + if (*p == '\0' || strlen(p) < strlen("Resource-CMap")) + return 0; + else if (!memcmp(p, "Resource-CMap", strlen("Resource-CMap"))) + return 1; + /* Otherwise ambiguious */ + return 0; +} + +static int +isdfont (FILE *fp) +{ + int i, n; + unsigned long pos; + + rewind(fp); + + get_unsigned_quad(fp); + seek_absolute(fp, (pos = get_unsigned_quad(fp)) + 0x18); + seek_absolute(fp, pos + get_unsigned_pair(fp)); + n = get_unsigned_pair(fp); + for (i = 0; i <= n; i++) { + if (get_unsigned_quad(fp) == 0x73666e74UL) /* "sfnt" */ + return 1; + get_unsigned_quad(fp); + } + return 0; +} + +/* This actually opens files. */ +static int +qcheck_filetype (const char *fqpn, int type) +{ + int r = 1; + FILE *fp; + + if (!fqpn) + return 0; + + fp = MFOPEN(fqpn, FOPEN_RBIN_MODE); + if (!fp) { + WARN("File \"%s\" found but I could not open that...", fqpn); + return 0; + } + switch (type) { + case DPX_RES_TYPE_T1FONT: + r = ist1binary(fp); + break; + case DPX_RES_TYPE_TTFONT: + r = istruetype(fp); + break; + case DPX_RES_TYPE_OTFONT: + r = isopentype(fp); + break; + case DPX_RES_TYPE_CMAP: + r = ispscmap(fp); + break; + case DPX_RES_TYPE_DFONT: + r = isdfont(fp); + break; + } + MFCLOSE(fp); + + return r; +} + diff --git a/Build/source/texk/dvipdfm-x/dpxfile.h b/Build/source/texk/dvipdfm-x/dpxfile.h new file mode 100644 index 00000000000..e4ae4c0a679 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/dpxfile.h @@ -0,0 +1,70 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + Copyright (C) 1998, 1999 by Mark A. Wicks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _DPXFILE_H_ +#define _DPXFILE_H_ + +#define DPX_CONFIG_FILE "dvipdfmx.cfg" + +#define DPX_RES_TYPE_FONTMAP 0x00 + +#define DPX_RES_TYPE_T1FONT 0x10 +#define DPX_RES_TYPE_TTFONT 0x11 +#define DPX_RES_TYPE_OTFONT 0x12 +#define DPX_RES_TYPE_PKFONT 0x13 +#define DPX_RES_TYPE_DFONT 0x14 + +#define DPX_RES_TYPE_ENC 0x20 +#define DPX_RES_TYPE_CMAP 0x21 +#define DPX_RES_TYPE_SFD 0x22 +#define DPX_RES_TYPE_AGL 0x23 + +#define DPX_RES_TYPE_ICCPROFILE 0x30 + +#define DPX_RES_TYPE_BINARY 0x40 +#define DPX_RES_TYPE_TEXT 0x41 + +#include "mfileio.h" +extern FILE *dpx_open_file (const char *filename, int type); + +extern char * dpx_find_type1_file (const char *filename); +extern char * dpx_find_truetype_file (const char *filename); +extern char * dpx_find_opentype_file (const char *filename); +extern char * dpx_find_dfont_file (const char *filename); + +#define DPXFOPEN(n,t) dpx_open_file((const char *)(n),(t)) +#define DPXFCLOSE(f) MFCLOSE((f)) + +extern void dpx_file_set_verbose (void); + +extern int dpx_file_apply_filter (const char *cmdtmpl, + const char *input, const char *output, + unsigned char version); +extern char *dpx_create_temp_file (void); +extern char *dpx_create_fix_temp_file (const char *filename); +extern void dpx_delete_old_cache (int life); +extern void dpx_delete_temp_file (char *tmp, int force); /* tmp freed here */ + +extern int keep_cache; +#endif /* _DPXFILE_H_ */ diff --git a/Build/source/texk/dvipdfm-x/fontmap.h b/Build/source/texk/dvipdfm-x/fontmap.h new file mode 100644 index 00000000000..fee6f238fa5 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/fontmap.h @@ -0,0 +1,109 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + Copyright (C) 1998, 1999 by Mark A. Wicks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _FONTMAP_H_ +#define _FONTMAP_H_ + +#define FONTMAP_RMODE_REPLACE 0 +#define FONTMAP_RMODE_APPEND '+' +#define FONTMAP_RMODE_REMOVE '-' + +#define FONTMAP_OPT_NOEMBED (1 << 1) +#define FONTMAP_OPT_VERT (1 << 2) + +#define FONTMAP_STYLE_NONE 0 +#define FONTMAP_STYLE_BOLD 1 +#define FONTMAP_STYLE_ITALIC 2 +#define FONTMAP_STYLE_BOLDITALIC 3 + +#ifdef XETEX +#include "ft2build.h" +#include FT_FREETYPE_H +#endif + +/* Options */ +typedef struct fontmap_opt { + /* Synthetic font */ + double slant, extend, bold; + /* comaptibility and other flags */ + long mapc, flags; + + char *otl_tags; /* currently unused */ + char *tounicode; /* not implemented yet */ + + double design_size; /* unused */ + + char *charcoll; /* Adobe-Japan1-4, etc. */ + int index; /* TTC index */ + int style; /* ,Bold, etc. */ + int stemv; /* StemV value especially for CJK fonts */ +#ifdef XETEX + FT_Face ft_face; +#endif +} fontmap_opt; + +typedef struct fontmap_rec { + char *map_name; + + char *font_name; + char *enc_name; + + /* Subfont mapping: translate 8-bit charcode to 16-bit charcode + * via SFD. + */ + struct { + char *sfd_name; + char *subfont_id; + } charmap; + + fontmap_opt opt; +} fontmap_rec; + +extern void pdf_fontmap_set_verbose (void); + +extern void pdf_init_fontmaps (void); +#if 0 +extern void pdf_clear_fontmaps (void); +#endif +extern void pdf_close_fontmaps (void); + +extern void pdf_init_fontmap_record (fontmap_rec *mrec); +extern void pdf_clear_fontmap_record (fontmap_rec *mrec); + +extern int pdf_load_fontmap_file (const char *filename, int mode); +extern int pdf_read_fontmap_line (fontmap_rec *mrec, const char *mline, long mline_strlen, int format); + +extern int pdf_append_fontmap_record (const char *kp, const fontmap_rec *mrec); +extern int pdf_remove_fontmap_record (const char *kp); +extern int pdf_insert_fontmap_record (const char *kp, const fontmap_rec *mrec); +extern fontmap_rec *pdf_lookup_fontmap_record (const char *kp); + +extern int is_pdfm_mapline (const char *mline); + +#ifdef XETEX +extern int pdf_load_native_font (const char *ps_name, + int layout_dir, int extend, int slant, int embolden); +#endif + +#endif /* _FONTMAP_H_ */ diff --git a/Build/source/texk/dvipdfm-x/jpegimage.h b/Build/source/texk/dvipdfm-x/jpegimage.h new file mode 100644 index 00000000000..437f01d6af3 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/jpegimage.h @@ -0,0 +1,38 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + Copyright (C) 1998, 1999 by Mark A. Wicks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _JPEGIMAGE_H_ +#define _JPEGIMAGE_H_ + +#include "mfileio.h" +#include "pdfximage.h" + +extern int check_for_jpeg (FILE *fp); +extern int jpeg_include_image (pdf_ximage *ximage, FILE *fp); +extern int jpeg_get_bbox (FILE *fp, long *width, long *height, + double *xdensity, double *ydensity); + +#endif /* _JPEGIMAGE_H_ */ + + diff --git a/Build/source/texk/dvipdfm-x/pngimage.h b/Build/source/texk/dvipdfm-x/pngimage.h new file mode 100644 index 00000000000..dd5ffe572ae --- /dev/null +++ b/Build/source/texk/dvipdfm-x/pngimage.h @@ -0,0 +1,41 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + Copyright (C) 1998, 1999 by Mark A. Wicks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + + +#ifndef _PNGIMAGE_H_ +#define _PNGIMAGE_H_ + +#ifdef HAVE_LIBPNG + +#include "mfileio.h" +#include "pdfximage.h" + +extern int png_include_image (pdf_ximage *ximage, FILE *file); +extern int check_for_png (FILE *file); +extern int png_get_bbox (FILE *fp, long *width, long *height, + double *xdensity, double *ydensity); + +#endif + +#endif /* _PNGIMAGE_H_ */ diff --git a/Build/source/texk/dvipdfm-x/src/cff_dict.c b/Build/source/texk/dvipdfm-x/src/cff_dict.c index bdd7280cdd8..68118577c74 100644 --- a/Build/source/texk/dvipdfm-x/src/cff_dict.c +++ b/Build/source/texk/dvipdfm-x/src/cff_dict.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. This program is free software; you can redistribute it and/or modify diff --git a/Build/source/texk/dvipdfm-x/src/cidtype0.c b/Build/source/texk/dvipdfm-x/src/cidtype0.c index ee8193dcd8e..db64c93bcc8 100644 --- a/Build/source/texk/dvipdfm-x/src/cidtype0.c +++ b/Build/source/texk/dvipdfm-x/src/cidtype0.c @@ -511,10 +511,14 @@ CIDFont_type0_dofont (CIDFont *font) if (!used_chars) ERROR("Unexpected error: Font not actually used???"); +#ifdef XETEX + sfont = sfnt_open(font->ft_face, SFNT_TYPE_POSTSCRIPT); +#else fp = DPXFOPEN(font->ident, DPX_RES_TYPE_OTFONT); if (!fp) ERROR("Could not open OpenType font file: %s", font->ident); sfont = sfnt_open(fp); +#endif if (!sfont) ERROR("Could not open OpenType font file: %s", font->ident); @@ -728,6 +732,11 @@ CIDFont_type0_open (CIDFont *font, const char *name, ASSERT(font); +#ifdef XETEX + sfont = sfnt_open(font->ft_face, SFNT_TYPE_POSTSCRIPT); + if (!sfont) + return -1; +#else fp = DPXFOPEN(name, DPX_RES_TYPE_OTFONT); if (!fp) return -1; @@ -736,6 +745,7 @@ CIDFont_type0_open (CIDFont *font, const char *name, if (!sfont) { ERROR("Not a CFF/OpenType font?"); } +#endif if (sfont->type != SFNT_TYPE_POSTSCRIPT || sfnt_read_table_directory(sfont, 0) < 0 || (offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) { @@ -896,11 +906,15 @@ CIDFont_type0_t1cdofont (CIDFont *font) if (!used_chars) ERROR("Unexpected error: Font not actually used???"); +#ifdef XETEX + sfont = sfnt_open(font->ft_face, SFNT_TYPE_POSTSCRIPT); +#else fp = DPXFOPEN(font->ident, DPX_RES_TYPE_OTFONT); if (!fp) ERROR("Could not open OpenType font file: %s", font->ident); sfont = sfnt_open(fp); +#endif if (!sfont) ERROR("Could not open OpenType font file: %s", font->ident); @@ -1144,11 +1158,17 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name, ASSERT(font); +#ifdef XETEX + sfont = sfnt_open(font->ft_face, SFNT_TYPE_POSTSCRIPT); + if (!sfont) + return -1; +#else fp = DPXFOPEN(name, DPX_RES_TYPE_OTFONT); if (!fp) return -1; sfont = sfnt_open(fp); +#endif if (!sfont) { ERROR("Not a CFF/OpenType font?"); } @@ -1517,6 +1537,11 @@ CIDFont_type0_t1open (CIDFont *font, const char *name, strcpy(fontname, shortname); RELEASE(shortname); +#ifdef XETEX + font->ft_to_gid = cff_get_ft_to_gid(cffont); + cffont->ft_to_gid = NULL; +#endif + cff_close(cffont); if (opt->style != FONT_STYLE_NONE) { @@ -2043,5 +2068,9 @@ CIDFont_type0_t1dofont (CIDFont *font) void CIDFont_type0_release(CIDFont *font) { +#ifdef XETEX + if (font->ft_to_gid) + RELEASE(font->ft_to_gid); +#endif return; } diff --git a/Build/source/texk/dvipdfm-x/src/cidtype2.c b/Build/source/texk/dvipdfm-x/src/cidtype2.c index 472be1c1607..ea20dae76f9 100644 --- a/Build/source/texk/dvipdfm-x/src/cidtype2.c +++ b/Build/source/texk/dvipdfm-x/src/cidtype2.c @@ -544,6 +544,9 @@ CIDFont_type2_dofont (CIDFont *font) return; } +#ifdef XETEX + sfont = sfnt_open(font->ft_face, SFNT_TYPE_TTC | SFNT_TYPE_TRUETYPE); +#else fp = DPXFOPEN(font->ident, DPX_RES_TYPE_TTFONT); if (!fp) { fp = DPXFOPEN(font->ident, DPX_RES_TYPE_DFONT); @@ -552,6 +555,7 @@ CIDFont_type2_dofont (CIDFont *font) } else { sfont = sfnt_open(fp); } +#endif if (!sfont) { ERROR("Could not open TTF file: %s", font->ident); @@ -564,8 +568,13 @@ CIDFont_type2_dofont (CIDFont *font) ERROR("Invalid TTC index in %s.", font->ident); break; case SFNT_TYPE_TRUETYPE: +#ifdef XETEX + /* disable the check here becuase sfnt_open() does not distinguish dfont + * from regular trutype */ +#else if (font->options->index > 0) ERROR("Found TrueType font file while expecting TTC file (%s).", font->ident); +#endif offset = 0; break; case SFNT_TYPE_DFONT: @@ -940,6 +949,11 @@ CIDFont_type2_open (CIDFont *font, const char *name, ASSERT(font && opt); +#ifdef XETEX + sfont = sfnt_open(font->ft_face, SFNT_TYPE_TTC | SFNT_TYPE_TRUETYPE); + if (!sfont) + return -1; +#else fp = DPXFOPEN(name, DPX_RES_TYPE_TTFONT); if (!fp) { fp = DPXFOPEN(name, DPX_RES_TYPE_DFONT); @@ -953,17 +967,21 @@ CIDFont_type2_open (CIDFont *font, const char *name, DPXFCLOSE(fp); return -1; } +#endif switch (sfont->type) { case SFNT_TYPE_TTC: offset = ttc_read_offset(sfont, opt->index); break; case SFNT_TYPE_TRUETYPE: - if (opt->index > 0) { +#ifdef XETEX + /* disable the check here becuase sfnt_open() does not distinguish dfont + * from regular trutype */ +#else + if (opt->index > 0) ERROR("Invalid TTC index (not TTC font): %s", name); - } else { - offset = 0; - } +#endif + offset = 0; break; case SFNT_TYPE_DFONT: offset = sfont->offset; diff --git a/Build/source/texk/dvipdfm-x/src/dpxfile.c b/Build/source/texk/dvipdfm-x/src/dpxfile.c deleted file mode 100644 index 75fa6da0801..00000000000 --- a/Build/source/texk/dvipdfm-x/src/dpxfile.c +++ /dev/null @@ -1,1153 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef _MSC_VER -#include -#endif - -#include - -#include "system.h" -#include "error.h" -#include "mem.h" - -#include "dpxutil.h" -#include "mfileio.h" - -#include "dpxfile.h" -#include "dpxcrypt.h" -#define MAX_KEY_LEN 16 - -#include -#include -#ifdef WIN32 -#include -#include -#else -#if HAVE_SYS_WAIT_H -#include -#endif -#ifndef WEXITSTATUS -#define WEXITSTATUS(val) ((unsigned)(val) >> 8) -#endif -#ifndef WIFEXITED -#define WIFEXITED(val) (((val) & 255) == 0) -#endif -#endif - -static int verbose = 0; -int keep_cache = 0; - -void -dpx_file_set_verbose (void) -{ - verbose++; -} - - -/* Kpathsea library does not check file type. */ -static int qcheck_filetype (const char *fqpn, int type); - -/* For testing MIKTEX enabled compilation */ -#if defined(TESTCOMPILE) && !defined(MIKTEX) -# define MIKTEX 1 -# define PATH_SEP_CHR '/' -# define _MAX_PATH 256 - -static int -miktex_get_acrobat_font_dir (char *buf) -{ - strcpy(buf, "/usr/share/ghostscript/Resource/Font/"); - return 1; -} - -static int -miktex_find_file (const char *filename, const char *dirlist, char *buf) -{ - int r = 0; - char *fqpn; - - fqpn = kpse_path_search(dirlist, filename, 0); - if (!fqpn) - return 0; - if (strlen(fqpn) > _MAX_PATH) - r = 0; - else { - strcpy(buf, fqpn); - r = 1; - } - RELEASE(fqpn); - - return r; -} - -static int -miktex_find_app_input_file (const char *progname, const char *filename, char *buf) -{ - int r = 0; - char *fqpn; - - kpse_reset_program_name(progname); - fqpn = kpse_find_file (filename, kpse_program_text_format, false); - kpse_reset_program_name(PACKAGE); - - if (!fqpn) - return 0; - if (strlen(fqpn) > _MAX_PATH) - r = 0; - else { - strcpy(buf, fqpn); - r = 1; - } - RELEASE(fqpn); - - return r; -} - -static int -miktex_find_psheader_file (const char *filename, char *buf) -{ - int r; - char *fqpn; - - fqpn = kpse_find_file(filename, kpse_tex_ps_header_format, 0); - - if (!fqpn) - return 0; - if (strlen(fqpn) > _MAX_PATH) - r = 0; - else { - strcpy(buf, fqpn); - r = 1; - } - RELEASE(fqpn); - - return r; -} - -#endif /* TESTCOMPILE */ - -#ifdef MIKTEX -#ifndef PATH_SEP_CHR -# define PATH_SEP_CHR '\\' -#endif -static char _tmpbuf[_MAX_PATH+1]; -#endif /* MIKTEX */ - -static int exec_spawn (char *cmd) -{ - char **cmdv, **qv; - char *p, *pp; - char buf[1024]; - int i, ret = -1; - - if (!cmd) - return -1; - while (*cmd == ' ' || *cmd == '\t') - cmd++; - if (*cmd == '\0') - return -1; - i = 0; - p = cmd; - while (*p) { - if (*p == ' ' || *p == '\t') - i++; - p++; - } - cmdv = xcalloc (i + 2, sizeof (char *)); - p = cmd; - qv = cmdv; - while (*p) { - pp = buf; - if (*p == '"') { - p++; - while (*p != '"') { - if (*p == '\0') { - goto done; - } - *pp++ = *p++; - } - p++; - } else if (*p == '\'') { - p++; - while (*p != '\'') { - if (*p == '\0') { - goto done; - } - *pp++ = *p++; - } - p++; - } else { - while (*p != ' ' && *p != '\t' && *p) { - if (*p == '\'') { - p++; - while (*p != '\'') { - if (*p == '\0') { - goto done; - } - *pp++ = *p++; - } - p++; - } else { - *pp++ = *p++; - } - } - } - *pp = '\0'; -#ifdef WIN32 - if (strchr (buf, ' ') || strchr (buf, '\t')) - *qv = concat3 ("\"", buf, "\""); - else -#endif - *qv = xstrdup (buf); -/* - fprintf(stderr,"\n%s", *qv); -*/ - while (*p == ' ' || *p == '\t') - p++; - qv++; - } -#ifdef WIN32 - ret = spawnvp (_P_WAIT, *cmdv, (const char* const*) cmdv); -#else - i = fork (); - if (i < 0) - ret = -1; - else if (i == 0) { - if (execvp (*cmdv, cmdv)) - _exit (-1); - } else { - if (wait (&ret) == i) { - ret = (WIFEXITED (ret) ? WEXITSTATUS (ret) : -1); - } else { - ret = -1; - } - } -#endif -done: - qv = cmdv; - while (*qv) { - free (*qv); - qv++; - } - free (cmdv); - return ret; -} - -/* ensuresuffix() returns a copy of basename if sfx is "". */ -static char * -ensuresuffix (const char *basename, const char *sfx) -{ - char *q, *p; - - p = NEW(strlen(basename) + strlen(sfx) + 1, char); - strcpy(p, basename); - q = strrchr(p, '.'); - if (!q && sfx[0]) - strcat(p, sfx); - - return p; -} - -#ifdef MIKTEX -static char * -dpx_find__app__xyz (const char *filename, - const char *suffix, int is_text) -{ - char *fqpn = NULL; - int r; - char *q; - - q = ensuresuffix(filename, suffix); - r = miktex_find_app_input_file(PACKAGE, q, _tmpbuf); - if (!r && strcmp(q, filename)) - r = miktex_find_app_input_file(PACKAGE, filename, _tmpbuf); - if (r) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } - RELEASE(q); - - return fqpn; -} - -static char * -dpx_foolsearch (const char *foolname, - const char *filename, - int is_text) -{ - char *fqpn = NULL; - int r; - - r = miktex_find_app_input_file(foolname, filename, _tmpbuf); - if (r) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } - - return fqpn; -} -#else /* !MIKTEX */ -# define TDS11DOC "http://www.tug.org/ftp/tex/tds-1.1/tds.html#Fonts" -static void -insistupdate (const char *filename, - const char *fqpn, - const char *foolname, - kpse_file_format_type foolformat, - kpse_file_format_type realformat) -{ - kpse_format_info_type *fif; - kpse_format_info_type *fir; - if (verbose < 1) - return; - fif = &kpse_format_info[foolformat]; - fir = &kpse_format_info[realformat]; - WARN("File name=\"%s\" format=\"%s\" might be found in different location than I expected:", - filename, fir->type); - WARN(">> %s", fqpn); - WARN(">> Please adjust your TEXMF as conformant with:"); - WARN(">> " TDS11DOC); - WARN(">> I searched it with fooling kpathsea as progname=\"%s\" format=\"%s\".", - foolname, fif->type); - WARN(">> Default search path for this format file is:"); - WARN(">> %s", fir->default_path); - WARN(">> Please read \"README\" file."); -} - -static char * -dpx_find__app__xyz (const char *filename, - const char *suffix, int is_text) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, suffix); - fqpn = kpse_find_file(q, - (is_text ? - kpse_program_text_format : kpse_program_binary_format), 0); - if (!fqpn && strcmp(q, filename)) - fqpn = kpse_find_file(filename, - (is_text ? - kpse_program_text_format : kpse_program_binary_format), 0); - RELEASE(q); - - return fqpn; -} - -static char * -dpx_foolsearch (const char *foolname, - const char *filename, - int is_text) -{ - char *fqpn = NULL; - - kpse_reset_program_name(foolname); - fqpn = kpse_find_file (filename, - (is_text ? - kpse_program_text_format : - kpse_program_binary_format), - false); - kpse_reset_program_name(PACKAGE); - - return fqpn; -} -#endif /* MIKTEX */ - -static char *dpx_find_fontmap_file (const char *filename); -static char *dpx_find_agl_file (const char *filename); -static char *dpx_find_sfd_file (const char *filename); -static char *dpx_find_cmap_file (const char *filename); -static char *dpx_find_enc_file (const char *filename); -static char *dpx_find_opentype_file (const char *filename); -static char *dpx_find_truetype_file (const char *filename); -static char *dpx_find_type1_file (const char *filename); -static char *dpx_find_iccp_file (const char *filename); -static char *dpx_find_dfont_file (const char *filename); - -FILE * -dpx_open_file (const char *filename, int type) -{ - FILE *fp = NULL; - char *fqpn = NULL; - - switch (type) { - case DPX_RES_TYPE_FONTMAP: - fqpn = dpx_find_fontmap_file(filename); - break; - case DPX_RES_TYPE_T1FONT: - fqpn = dpx_find_type1_file(filename); - break; - case DPX_RES_TYPE_TTFONT: - fqpn = dpx_find_truetype_file(filename); - break; - case DPX_RES_TYPE_OTFONT: - fqpn = dpx_find_opentype_file(filename); - break; - case DPX_RES_TYPE_PKFONT: - break; - case DPX_RES_TYPE_CMAP: - fqpn = dpx_find_cmap_file(filename); - break; - case DPX_RES_TYPE_ENC: - fqpn = dpx_find_enc_file(filename); - break; - case DPX_RES_TYPE_SFD: - fqpn = dpx_find_sfd_file(filename); - break; - case DPX_RES_TYPE_AGL: - fqpn = dpx_find_agl_file(filename); - break; - case DPX_RES_TYPE_ICCPROFILE: - fqpn = dpx_find_iccp_file(filename); - break; - case DPX_RES_TYPE_DFONT: - fqpn = dpx_find_dfont_file(filename); - break; - case DPX_RES_TYPE_BINARY: - fqpn = dpx_find__app__xyz(filename, "", 0); - break; - case DPX_RES_TYPE_TEXT: - fqpn = dpx_find__app__xyz(filename, "", 1); - break; - default: - ERROR("Unknown resource type: %d", type); - break; - } - if (fqpn) { - fp = MFOPEN(fqpn, FOPEN_RBIN_MODE); - RELEASE(fqpn); - } - - return fp; -} - - -static char * -dpx_find_iccp_file (const char *filename) -{ - char *fqpn = NULL; - - fqpn = dpx_find__app__xyz(filename, "", 0); - if (fqpn || strrchr(filename, '.')) - return fqpn; - - fqpn = dpx_find__app__xyz(filename, ".icc", 0); - if (fqpn) - return fqpn; - - fqpn = dpx_find__app__xyz(filename, ".icm", 0); - - return fqpn; -} - - -static char * -dpx_find_fontmap_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, ".map"); -#ifdef MIKTEX - fqpn = dpx_find__app__xyz(q, ".map", 1); -#else /* !MIKTEX */ - fqpn = kpse_find_file(q, kpse_fontmap_format, 0); - if (!fqpn) { - fqpn = dpx_find__app__xyz(q, ".map", 1); - if (fqpn) - insistupdate(q, fqpn, PACKAGE, - kpse_program_text_format, kpse_fontmap_format); - } -#endif /* MIKETEX */ - RELEASE(q); - - return fqpn; -} - - -static char * -dpx_find_agl_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, ".txt"); -#ifdef MIKTEX - fqpn = dpx_find__app__xyz(q, ".txt", 1); -#else /* !MIKTEX */ - fqpn = kpse_find_file(q, kpse_fontmap_format, 0); - if (!fqpn) { - fqpn = dpx_find__app__xyz(q, ".txt", 1); - if (fqpn) - insistupdate(q, fqpn, PACKAGE, - kpse_program_text_format, kpse_fontmap_format); - } -#endif /* MIKETEX */ - RELEASE(q); - - return fqpn; -} - - -/* cmap.sty put files into tex/latex/cmap */ -static char * -dpx_find_cmap_file (const char *filename) -{ - char *fqpn = NULL; - static const char *fools[] = { - "cmap", "tex", NULL - }; - int i; - -#if defined(MIKTEX) - /* Find in Acrobat's Resource/CMap dir */ - { - char _acrodir[_MAX_PATH+1]; - char *q; - int r; - - memset(_acrodir, 0, _MAX_PATH+1); - r = miktex_get_acrobat_font_dir(_acrodir); - if (r && - strlen(_acrodir) > strlen("Font")) { - /* ....\Font\ */ - q = strrchr(_acrodir, PATH_SEP_CHR); - if (q && q[1] == '\0') - q[0] = '\0'; - q = strrchr(_acrodir, PATH_SEP_CHR); - if (q && !strcmp(q + 1, "Font")) { - sprintf(q, "%cCMap%c", PATH_SEP_CHR, PATH_SEP_CHR); - r = miktex_find_file(filename, _acrodir, _tmpbuf); - if (r) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } - } - } - memset(_tmpbuf, 0, _MAX_PATH+1); - } -#else - fqpn = kpse_find_file(filename, kpse_cmap_format, 0); -#endif - - /* Files found above are assumed to be CMap, - * if it's not really CMap it will cause an error. - */ - for (i = 0; !fqpn && fools[i]; i++) { - fqpn = dpx_foolsearch(fools[i], filename, 1); - if (fqpn) { -#ifndef MIKTEX - insistupdate(filename, fqpn, fools[i], - kpse_program_text_format, kpse_cmap_format); -#endif - if (!qcheck_filetype(fqpn, DPX_RES_TYPE_CMAP)) { - WARN("Found file \"%s\" for PostScript CMap but it doesn't look like a CMap...", fqpn); - RELEASE(fqpn); - fqpn = NULL; - } - } - } - - return fqpn; -} - - -/* Search order: - * SFDFONTS (TDS 1.1) - * ttf2pk (text file) - * ttf2tfm (text file) - * dvipdfm (text file) - */ -static char * -dpx_find_sfd_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - static const char *fools[] = { - "ttf2pk", "ttf2tfm", NULL - }; - int i; - - q = ensuresuffix(filename, ".sfd"); -#ifndef MIKTEX - fqpn = kpse_find_file(q, kpse_sfd_format, 0); -#endif /* !MIKTEX */ - - for (i = 0; !fqpn && fools[i]; i++) { - fqpn = dpx_foolsearch(fools[i], q, 1); -#ifndef MIKTEX - if (fqpn) - insistupdate(filename, fqpn, fools[i], - kpse_program_text_format, kpse_sfd_format); -#endif - } - RELEASE(q); - - return fqpn; -} - - -static char * -dpx_find_enc_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - static const char *fools[] = { - "dvips", NULL - }; - int i; - - q = ensuresuffix(filename, ".enc"); -#ifdef MIKTEX - if (miktex_find_psheader_file(q, _tmpbuf)) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } -#else - fqpn = kpse_find_file(q, kpse_enc_format, 0); -#endif /* MIKTEX */ - - for (i = 0; !fqpn && fools[i]; i++) { - fqpn = dpx_foolsearch(fools[i], q, 1); -#ifndef MIKTEX - if (fqpn) - insistupdate(filename, fqpn, fools[i], - kpse_program_text_format, kpse_enc_format); -#endif - } - RELEASE(q); - - return fqpn; -} - - -static char * -dpx_find_type1_file (const char *filename) -{ - char *fqpn = NULL; - - fqpn = kpse_find_file(filename, kpse_type1_format, 0); - if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_T1FONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - - return fqpn; -} - - -static char * -dpx_find_truetype_file (const char *filename) -{ - char *fqpn = NULL; - - fqpn = kpse_find_file(filename, kpse_truetype_format, 0); - if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_TTFONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - - return fqpn; -} - - -static char * -dpx_find_opentype_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, ".otf"); -#ifndef MIKTEX - fqpn = kpse_find_file(q, kpse_opentype_format, 0); - if (!fqpn) { -#endif - fqpn = dpx_foolsearch(PACKAGE, q, 0); -#ifndef MIKTEX - if (fqpn) - insistupdate(filename, fqpn, PACKAGE, - kpse_program_binary_format, kpse_opentype_format); - } -#endif - RELEASE(q); - - /* *We* use "opentype" for ".otf" (CFF). */ - if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_OTFONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - - return fqpn; -} - - -static char * -dpx_find_dfont_file (const char *filename) -{ - char *fqpn = NULL; - - fqpn = kpse_find_file(filename, kpse_truetype_format, 0); - if (fqpn) { - int len = strlen(fqpn); - if (len > 6 && strncmp(fqpn+len-6, ".dfont", 6)) { - fqpn = RENEW(fqpn, len+6, char); - strcat(fqpn, "/rsrc"); - } - } - if (!qcheck_filetype(fqpn, DPX_RES_TYPE_DFONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - return fqpn; -} - -static const char * -dpx_get_tmpdir (void) -{ -# ifdef WIN32 -# define __TMPDIR "." -# else /* WIN32 */ -# define __TMPDIR "/tmp" -#endif /* WIN32 */ - const char *_tmpd; - -# ifdef HAVE_GETENV - _tmpd = getenv("TMPDIR"); -# ifdef WIN32 - if (!_tmpd) - _tmpd = getenv("TMP"); - if (!_tmpd) - _tmpd = getenv("TEMP"); -# endif /* WIN32 */ - if (!_tmpd) - _tmpd = __TMPDIR; -# else /* HAVE_GETENV */ - _tmpd = __TMPDIR; -# endif /* HAVE_GETENV */ - return _tmpd; -} - -#ifdef HAVE_MKSTEMP -# include -#endif - -#ifdef XETEX -char * -dpx_create_temp_file (void) -{ - char *tmp = NULL; - -#if defined(MIKTEX) - { - tmp = NEW(_MAX_PATH + 1, char); - miktex_create_temp_file_name(tmp); /* FIXME_FIXME */ - } -#elif defined(HAVE_MKSTEMP) -# define TEMPLATE "/dvipdfmx.XXXXXX" - { - const char *_tmpd; - int _fd = -1; - _tmpd = dpx_get_tmpdir(); - tmp = NEW(strlen(_tmpd) + strlen(TEMPLATE) + 1, char); - strcpy(tmp, _tmpd); - strcat(tmp, TEMPLATE); - _fd = mkstemp(tmp); - if (_fd != -1) -#ifdef WIN32 - _close(_fd); -#else - close(_fd); -#endif /* WIN32 */ - else { - RELEASE(tmp); - tmp = NULL; - } - } -#else /* use _tempnam or tmpnam */ - { -# ifdef WIN32 - const char *_tmpd; - char *p; - _tmpd = dpx_get_tmpdir(); - tmp = _tempnam (_tmpd, "dvipdfmx."); - for (p = tmp; *p; p++) { - if (IS_KANJI (p)) - p++; - else if (*p == '\\') - *p = '/'; - } -# else /* WIN32 */ - char *_tmpa = NEW(L_tmpnam + 1, char); - tmp = tmpnam(_tmpa); - if (!tmp) - RELEASE(_tmpa); -# endif /* WIN32 */ - } -#endif /* MIKTEX */ - - return tmp; -} -#endif /* XETEX */ - -char * -dpx_create_fix_temp_file (const char *filename) -{ -#define PREFIX "dvipdfmx." - static const char *dir = NULL; - static char *cwd = NULL; - char *ret, *s; - int i; - MD5_CONTEXT state; - unsigned char digest[MAX_KEY_LEN]; -#ifdef WIN32 - char *p; -#endif - - if (!dir) { - dir = dpx_get_tmpdir(); - cwd = xgetcwd(); - } - - MD5_init(&state); - MD5_write(&state, (unsigned char *)cwd, strlen(cwd)); - MD5_write(&state, (unsigned const char *)filename, strlen(filename)); - MD5_final(digest, &state); - - ret = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); - sprintf(ret, "%s/%s", dir, PREFIX); - s = ret + strlen(ret); - for (i=0; id_name) != plen + MAX_KEY_LEN * 2) return 0; -#ifdef WIN32 - return strncasecmp(ent->d_name, PREFIX, plen) == 0; -#else - return strncmp(ent->d_name, PREFIX, plen) == 0; -#endif -} - -void -dpx_delete_old_cache (int life) -{ - const char *dir; - char *pathname; - DIR *dp; - struct dirent *de; - time_t limit; - - if (life == -2) { - keep_cache = -1; - return; - } - - dir = dpx_get_tmpdir(); - pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); - limit = time(NULL) - life * 60 * 60; - - if (life >= 0) keep_cache = 1; - if ((dp = opendir(dir)) != NULL) { - while((de = readdir(dp)) != NULL) { - if (dpx_clear_cache_filter(de)) { - struct stat sb; - sprintf(pathname, "%s/%s", dir, de->d_name); - stat(pathname, &sb); - if (sb.st_mtime < limit) { - remove(pathname); - /* printf("remove: %s\n", pathname); */ - } - } - } - closedir(dp); - } - RELEASE(pathname); -} - -void -dpx_delete_temp_file (char *tmp, int force) -{ - if (!tmp) - return; - if (force || keep_cache != 1) remove (tmp); - RELEASE(tmp); - - return; -} - -/* dpx_file_apply_filter() is used for converting unsupported graphics - * format to one of the formats that dvipdfmx can natively handle. - * 'input' is the filename of the original file and 'output' is actually - * temporal files 'generated' by the above routine. - * This should be system dependent. (MiKTeX may want something different) - * Please modify as appropriate (see also pdfximage.c and dvipdfmx.c). - */ -int -dpx_file_apply_filter (const char *cmdtmpl, - const char *input, const char *output, - unsigned char version) -{ - char *cmd = NULL; - const char *p, *q; - size_t n, size; - int error = 0; - - if (!cmdtmpl) - return -1; - else if (!input || !output) - return -1; - - size = strlen(cmdtmpl) + strlen(input) + strlen(output) + 3; - cmd = NEW(size, char); - memset(cmd, 0, size); - for (n = 0, p = cmdtmpl; *p != 0; p++) { -#define need(s,l,m,n) \ -if ((l) + (n) >= (m)) { \ - (m) += (n) + 128; \ - (s) = RENEW((s), (m), char); \ -} - if (p[0] == '%') { - p++; - switch (p[0]) { - case 'o': /* Output file name */ - need(cmd, n, size, strlen(output)); - strcpy(cmd + n, output); n += strlen(output); - break; - case 'i': /* Input filename */ - need(cmd, n, size, strlen(input)); - strcpy(cmd + n, input); n += strlen(input); - break; - case 'b': - need(cmd, n, size, strlen(input)); - q = strrchr(input, '.'); /* wrong */ - if (q) { - memcpy(cmd + n, input, (int) (q - input)); - n += (int) (q - input); - } else { - strcpy(cmd + n, input); n += strlen(input); - } - case 'v': /* Version number, e.g. 1.4 */ { - char buf[16]; - sprintf(buf, "1.%hu", (unsigned short) version); - need(cmd, n, size, strlen(buf)); - strcpy(cmd + n, buf); n += strlen(buf); - break; - } - case 0: - break; - case '%': - need(cmd, n, size, 1); - cmd[n] = '%'; n++; - break; - } - } else { - need(cmd, n, size, 1); - cmd[n] = p[0]; n++; - } - } - need(cmd, n, size, 1); - cmd[n] = '\0'; - if (strlen(cmd) == 0) { - RELEASE(cmd); - return -1; - } - - error = exec_spawn(cmd); - if (error) - WARN("Filtering file via command -->%s<-- failed.", cmd); - RELEASE(cmd); - - return error; -} - -static char _sbuf[128]; -/* - * SFNT type sigs: - * `true' (0x74727565): TrueType (Mac) - * `typ1' (0x74797031) (Mac): PostScript font housed in a sfnt wrapper - * 0x00010000: TrueType (Win)/OpenType - * `OTTO': PostScript CFF font with OpenType wrapper - * `ttcf': TrueType Collection - */ -static int -istruetype (FILE *fp) -{ - int n; - - rewind(fp); - n = fread(_sbuf, 1, 4, fp); - rewind(fp); - - if (n != 4) - return 0; - else if (!memcmp(_sbuf, "true", 4) || - !memcmp(_sbuf, "\0\1\0\0", 4)) /* This doesn't help... */ - return 1; - else if (!memcmp(_sbuf, "ttcf", 4)) - return 1; - - return 0; -} - -/* "OpenType" is only for ".otf" here */ -static int -isopentype (FILE *fp) -{ - int n; - - rewind(fp); - n = fread(_sbuf, 1, 4, fp); - rewind(fp); - - if (n != 4) - return 0; - else if (!memcmp(_sbuf, "OTTO", 4)) - return 1; - else - return 0; -} - -static int -ist1binary (FILE *fp) -{ - char *p; - int n; - - rewind(fp); - n = fread(_sbuf, 1, 21, fp); - rewind(fp); - - p = _sbuf; - if (n != 21) - return 0; - else if (p[0] != (char) 0x80 || p[1] < 0 || p[1] > 3) - return 0; - else if (!memcmp(p + 6, "%!PS-AdobeFont", 14) || - !memcmp(p + 6, "%!FontType1", 11)) - return 1; - else if (!memcmp(p + 6, "%!PS", 4)) { -#if 0 - p[20] = '\0'; p += 6; - WARN("Ambiguous PostScript resource type: %s", (char *) p); -#endif - return 1; - } - /* Otherwise ambiguious */ - return 0; -} - -/* %!PS-Adobe-x.y Resource-CMap */ -static int -ispscmap (FILE *fp) -{ - char *p; - p = mfgets(_sbuf, 128, fp); p[127] = '\0'; - if (!p || strlen(p) < 4 || memcmp(p, "%!PS", 4)) - return 0; - for (p += 4; *p && !isspace(*p); p++); - for ( ; *p && (*p == ' ' || *p == '\t'); p++); - if (*p == '\0' || strlen(p) < strlen("Resource-CMap")) - return 0; - else if (!memcmp(p, "Resource-CMap", strlen("Resource-CMap"))) - return 1; - /* Otherwise ambiguious */ - return 0; -} - -static int -isdfont (FILE *fp) -{ - int i, n; - unsigned long pos; - - rewind(fp); - - get_unsigned_quad(fp); - seek_absolute(fp, (pos = get_unsigned_quad(fp)) + 0x18); - seek_absolute(fp, pos + get_unsigned_pair(fp)); - n = get_unsigned_pair(fp); - for (i = 0; i <= n; i++) { - if (get_unsigned_quad(fp) == 0x73666e74UL) /* "sfnt" */ - return 1; - get_unsigned_quad(fp); - } - return 0; -} - -/* This actually opens files. */ -static int -qcheck_filetype (const char *fqpn, int type) -{ - int r = 1; - FILE *fp; - - if (!fqpn) - return 0; - - fp = MFOPEN(fqpn, FOPEN_RBIN_MODE); - if (!fp) { - WARN("File \"%s\" found but I could not open that...", fqpn); - return 0; - } - switch (type) { - case DPX_RES_TYPE_T1FONT: - r = ist1binary(fp); - break; - case DPX_RES_TYPE_TTFONT: - r = istruetype(fp); - break; - case DPX_RES_TYPE_OTFONT: - r = isopentype(fp); - break; - case DPX_RES_TYPE_CMAP: - r = ispscmap(fp); - break; - case DPX_RES_TYPE_DFONT: - r = isdfont(fp); - break; - } - MFCLOSE(fp); - - return r; -} - diff --git a/Build/source/texk/dvipdfm-x/src/dpxfile.h b/Build/source/texk/dvipdfm-x/src/dpxfile.h deleted file mode 100644 index df95b8c5411..00000000000 --- a/Build/source/texk/dvipdfm-x/src/dpxfile.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _DPXFILE_H_ -#define _DPXFILE_H_ - -#define DPX_CONFIG_FILE "dvipdfmx.cfg" - -#define DPX_RES_TYPE_FONTMAP 0x00 - -#define DPX_RES_TYPE_T1FONT 0x10 -#define DPX_RES_TYPE_TTFONT 0x11 -#define DPX_RES_TYPE_OTFONT 0x12 -#define DPX_RES_TYPE_PKFONT 0x13 -#define DPX_RES_TYPE_DFONT 0x14 - -#define DPX_RES_TYPE_ENC 0x20 -#define DPX_RES_TYPE_CMAP 0x21 -#define DPX_RES_TYPE_SFD 0x22 -#define DPX_RES_TYPE_AGL 0x23 - -#define DPX_RES_TYPE_ICCPROFILE 0x30 - -#define DPX_RES_TYPE_BINARY 0x40 -#define DPX_RES_TYPE_TEXT 0x41 - -#include "mfileio.h" -extern FILE *dpx_open_file (const char *filename, int type); - -#define DPXFOPEN(n,t) dpx_open_file((const char *)(n),(t)) -#define DPXFCLOSE(f) MFCLOSE((f)) - -extern void dpx_file_set_verbose (void); - -extern int dpx_file_apply_filter (const char *cmdtmpl, - const char *input, const char *output, - unsigned char version); -extern char *dpx_create_temp_file (void); -extern char *dpx_create_fix_temp_file (const char *filename); -extern void dpx_delete_old_cache (int life); -extern void dpx_delete_temp_file (char *tmp, int force); /* tmp freed here */ - -extern int keep_cache; -#endif /* _DPXFILE_H_ */ diff --git a/Build/source/texk/dvipdfm-x/src/dvipdfmx.c b/Build/source/texk/dvipdfm-x/src/dvipdfmx.c index eb4fb13cbad..d2eb97330ba 100644 --- a/Build/source/texk/dvipdfm-x/src/dvipdfmx.c +++ b/Build/source/texk/dvipdfm-x/src/dvipdfmx.c @@ -2,7 +2,7 @@ This is DVIPDFMx, an eXtended version of DVIPDFM by Mark A. Wicks. - Copyright (C) 2009-2013 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + Copyright (C) 2002-2013 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks @@ -875,7 +875,7 @@ main (int argc, char *argv[]) if (STRN_CMP(base, "extractbb", 9) == 0 || STRN_CMP(base, "xbb", 3) == 0 || STRN_CMP(base, "ebb", 3) == 0) - return extractbb(argc, argv); + return extractbb(argc, argv, 0); } if (argc < 2) { diff --git a/Build/source/texk/dvipdfm-x/src/fontmap.h b/Build/source/texk/dvipdfm-x/src/fontmap.h deleted file mode 100644 index 2624e856c5d..00000000000 --- a/Build/source/texk/dvipdfm-x/src/fontmap.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _FONTMAP_H_ -#define _FONTMAP_H_ - -#define FONTMAP_RMODE_REPLACE 0 -#define FONTMAP_RMODE_APPEND '+' -#define FONTMAP_RMODE_REMOVE '-' - -#define FONTMAP_OPT_NOEMBED (1 << 1) -#define FONTMAP_OPT_VERT (1 << 2) - -#define FONTMAP_STYLE_NONE 0 -#define FONTMAP_STYLE_BOLD 1 -#define FONTMAP_STYLE_ITALIC 2 -#define FONTMAP_STYLE_BOLDITALIC 3 - -#ifdef XETEX -#include "ft2build.h" -#include FT_FREETYPE_H -#endif - -/* Options */ -typedef struct fontmap_opt { - /* Synthetic font */ - double slant, extend, bold; - /* comaptibility and other flags */ - long mapc, flags; - - char *otl_tags; /* currently unused */ - char *tounicode; /* not implemented yet */ - - double design_size; /* unused */ - - char *charcoll; /* Adobe-Japan1-4, etc. */ - int index; /* TTC index */ - int style; /* ,Bold, etc. */ - int stemv; /* StemV value especially for CJK fonts */ -#ifdef XETEX - FT_Face ft_face; - unsigned short *glyph_widths; -#endif -} fontmap_opt; - -typedef struct fontmap_rec { - char *map_name; - - char *font_name; - char *enc_name; - - /* Subfont mapping: translate 8-bit charcode to 16-bit charcode - * via SFD. - */ - struct { - char *sfd_name; - char *subfont_id; - } charmap; - - fontmap_opt opt; -} fontmap_rec; - -extern void pdf_fontmap_set_verbose (void); - -extern void pdf_init_fontmaps (void); -#if 0 -extern void pdf_clear_fontmaps (void); -#endif -extern void pdf_close_fontmaps (void); - -extern void pdf_init_fontmap_record (fontmap_rec *mrec); -extern void pdf_clear_fontmap_record (fontmap_rec *mrec); - -extern int pdf_load_fontmap_file (const char *filename, int mode); -extern int pdf_read_fontmap_line (fontmap_rec *mrec, const char *mline, long mline_strlen, int format); - -extern int pdf_append_fontmap_record (const char *kp, const fontmap_rec *mrec); -extern int pdf_remove_fontmap_record (const char *kp); -extern int pdf_insert_fontmap_record (const char *kp, const fontmap_rec *mrec); -extern fontmap_rec *pdf_lookup_fontmap_record (const char *kp); - -extern int is_pdfm_mapline (const char *mline); - -#ifdef XETEX -extern int pdf_load_native_font (const char *ps_name, - const char *fam_name, const char *sty_name, - int layout_dir, int extend, int slant, int embolden); -#endif - -#endif /* _FONTMAP_H_ */ diff --git a/Build/source/texk/dvipdfm-x/src/jpegimage.c b/Build/source/texk/dvipdfm-x/src/jpegimage.c index 903a810cebe..368c759aca4 100644 --- a/Build/source/texk/dvipdfm-x/src/jpegimage.c +++ b/Build/source/texk/dvipdfm-x/src/jpegimage.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks diff --git a/Build/source/texk/dvipdfm-x/src/jpegimage.h b/Build/source/texk/dvipdfm-x/src/jpegimage.h deleted file mode 100644 index 437f01d6af3..00000000000 --- a/Build/source/texk/dvipdfm-x/src/jpegimage.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _JPEGIMAGE_H_ -#define _JPEGIMAGE_H_ - -#include "mfileio.h" -#include "pdfximage.h" - -extern int check_for_jpeg (FILE *fp); -extern int jpeg_include_image (pdf_ximage *ximage, FILE *fp); -extern int jpeg_get_bbox (FILE *fp, long *width, long *height, - double *xdensity, double *ydensity); - -#endif /* _JPEGIMAGE_H_ */ - - diff --git a/Build/source/texk/dvipdfm-x/src/pdfencrypt.c b/Build/source/texk/dvipdfm-x/src/pdfencrypt.c index 3eb3c9ff020..1652af4b7f5 100644 --- a/Build/source/texk/dvipdfm-x/src/pdfencrypt.c +++ b/Build/source/texk/dvipdfm-x/src/pdfencrypt.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. This program is free software; you can redistribute it and/or modify diff --git a/Build/source/texk/dvipdfm-x/src/pdfparse.c b/Build/source/texk/dvipdfm-x/src/pdfparse.c index f1218cb7bb8..c05d37ed454 100644 --- a/Build/source/texk/dvipdfm-x/src/pdfparse.c +++ b/Build/source/texk/dvipdfm-x/src/pdfparse.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks diff --git a/Build/source/texk/dvipdfm-x/src/pngimage.c b/Build/source/texk/dvipdfm-x/src/pngimage.c index a7ecde3de53..2583a8a6ced 100644 --- a/Build/source/texk/dvipdfm-x/src/pngimage.c +++ b/Build/source/texk/dvipdfm-x/src/pngimage.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks diff --git a/Build/source/texk/dvipdfm-x/src/pngimage.h b/Build/source/texk/dvipdfm-x/src/pngimage.h deleted file mode 100644 index dd5ffe572ae..00000000000 --- a/Build/source/texk/dvipdfm-x/src/pngimage.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - - -#ifndef _PNGIMAGE_H_ -#define _PNGIMAGE_H_ - -#ifdef HAVE_LIBPNG - -#include "mfileio.h" -#include "pdfximage.h" - -extern int png_include_image (pdf_ximage *ximage, FILE *file); -extern int check_for_png (FILE *file); -extern int png_get_bbox (FILE *fp, long *width, long *height, - double *xdensity, double *ydensity); - -#endif - -#endif /* _PNGIMAGE_H_ */ diff --git a/Build/source/texk/dvipdfm-x/src/spc_html.c b/Build/source/texk/dvipdfm-x/src/spc_html.c index 6a533b5d41f..779f3ffb0d7 100644 --- a/Build/source/texk/dvipdfm-x/src/spc_html.c +++ b/Build/source/texk/dvipdfm-x/src/spc_html.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks diff --git a/Build/source/texk/dvipdfm-x/src/tt_cmap.c b/Build/source/texk/dvipdfm-x/src/tt_cmap.c index 1d7f34a6ccd..9761e92de25 100644 --- a/Build/source/texk/dvipdfm-x/src/tt_cmap.c +++ b/Build/source/texk/dvipdfm-x/src/tt_cmap.c @@ -1021,6 +1021,9 @@ create_ToUnicode_cmap12 (struct cmap12 *map, pdf_obj * otf_create_ToUnicode_stream (const char *font_name, int ttc_index, /* 0 for non-TTC */ +#ifdef XETEX + FT_Face face, +#endif const char *used_glyphs) { pdf_obj *cmap_ref = NULL; @@ -1063,6 +1066,9 @@ otf_create_ToUnicode_stream (const char *font_name, MESG("otf_cmap>> Creating ToUnicode CMap for \"%s\"...\n", font_name); } +#ifdef XETEX + sfont = sfnt_open(face, -1); +#else fp = DPXFOPEN(font_name, DPX_RES_TYPE_TTFONT); if (!fp) { fp = DPXFOPEN(font_name, DPX_RES_TYPE_OTFONT); @@ -1074,6 +1080,8 @@ otf_create_ToUnicode_stream (const char *font_name, } sfont = sfnt_open(fp); +#endif + if (!sfont) { ERROR("Could not open TrueType font file \"%s\"", font_name); } diff --git a/Build/source/texk/dvipdfm-x/src/tt_cmap.h b/Build/source/texk/dvipdfm-x/src/tt_cmap.h deleted file mode 100644 index 4f937ad7fbe..00000000000 --- a/Build/source/texk/dvipdfm-x/src/tt_cmap.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _TT_CMAP_H_ -#define _TT_CMAP_H_ - -#include "sfnt.h" - -extern void otf_cmap_set_verbose (void); - -/* TrueType cmap table */ -typedef struct -{ - USHORT format; - USHORT platform; - USHORT encoding; - ULONG language; /* or version, only for Mac */ - void *map; -} tt_cmap; - -/* Paltform ID */ -#define TT_MAC 1u -#define TT_WIN 3u - -/* Platform-specific encoding ID */ - -/* Windows */ -#define TT_WIN_SYMBOL 0u -#define TT_WIN_UNICODE 1u -#define TT_WIN_SJIS 2u -#define TT_WIN_RPC 3u -#define TT_WIN_BIG5 4u -#define TT_WIN_WANSUNG 5u -#define TT_WIN_JOHAB 6u -#define TT_WIN_UCS4 10u - -/* Mac */ -#define TT_MAC_ROMAN 0u -#define TT_MAC_JAPANESE 1u -#define TT_MAC_TRADITIONAL_CHINESE 2u -#define TT_MAC_KOREAN 3u -#define TT_MAC_SIMPLIFIED_CHINESE 25u - -extern tt_cmap *tt_cmap_read (sfnt *sfont, USHORT platform, USHORT encoding); - -extern USHORT tt_cmap_lookup (tt_cmap *cmap, long cc); -extern void tt_cmap_release (tt_cmap *cmap); - -#include "pdfobj.h" - -/* Indirect reference */ -extern pdf_obj *otf_create_ToUnicode_stream (const char *map_name, - int ttc_index, - const char *used_glyphs); -/* CMap ID */ -extern int otf_load_Unicode_CMap (const char *map_name, - int ttc_index, - const char *otl_opts, int wmode); - -#endif /* _TT_CMAP_H_ */ diff --git a/Build/source/texk/dvipdfm-x/src/tt_table.c b/Build/source/texk/dvipdfm-x/src/tt_table.c index 6ec43a0a1df..3f8d0157103 100644 --- a/Build/source/texk/dvipdfm-x/src/tt_table.c +++ b/Build/source/texk/dvipdfm-x/src/tt_table.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. This program is free software; you can redistribute it and/or modify @@ -79,11 +79,10 @@ char *tt_pack_head_table (struct tt_head_table *table) struct tt_head_table *tt_read_head_table (sfnt *sfont) { int i; - struct tt_head_table *table = NULL; + struct tt_head_table *table = NEW(1, struct tt_head_table); sfnt_locate_table(sfont, "head"); - table = NEW(1, struct tt_head_table); table->version = sfnt_get_ulong(sfont); table->fontRevision = sfnt_get_ulong(sfont); table->checkSumAdjustment = sfnt_get_ulong(sfont); @@ -135,11 +134,10 @@ char *tt_pack_maxp_table (struct tt_maxp_table *table) struct tt_maxp_table *tt_read_maxp_table (sfnt *sfont) { - struct tt_maxp_table *table = NULL; + struct tt_maxp_table *table = NEW(1, struct tt_maxp_table); sfnt_locate_table(sfont, "maxp"); - table = NEW(1, struct tt_maxp_table); table->version = sfnt_get_ulong(sfont); table->numGlyphs = sfnt_get_ushort(sfont); table->maxPoints = sfnt_get_ushort(sfont); @@ -190,11 +188,10 @@ tt_read_hhea_table (sfnt *sfont) { int i; ULONG len; - struct tt_hhea_table *table = NULL; + struct tt_hhea_table *table = NEW(1, struct tt_hhea_table); sfnt_locate_table(sfont, "hhea"); - table = NEW(1, struct tt_hhea_table); table->version = sfnt_get_ulong(sfont); table->ascent = sfnt_get_short (sfont); table->descent = sfnt_get_short(sfont); @@ -254,11 +251,10 @@ struct tt_vhea_table *tt_read_vhea_table (sfnt *sfont) { int i; ULONG len; - struct tt_vhea_table *table = NULL; + struct tt_vhea_table *table = NEW(1, struct tt_vhea_table); sfnt_locate_table(sfont, "vhea"); - table = NEW(1, struct tt_vhea_table); table->version = sfnt_get_ulong(sfont); table->vertTypoAscender = sfnt_get_short (sfont); table->vertTypoDescender = sfnt_get_short(sfont); @@ -455,7 +451,7 @@ tt_get_name (sfnt *sfont, char *dest, USHORT destlen, length = destlen - 1; } sfnt_seek_set (sfont, name_offset+string_offset+offset); - sfnt_read(dest, length, sfont); + sfnt_read((unsigned char*)dest, length, sfont); dest[length] = '\0'; break; } @@ -472,6 +468,19 @@ tt_get_ps_fontname (sfnt *sfont, char *dest, USHORT destlen) { USHORT namelen = 0; +#ifdef XETEX + + const char* name = FT_Get_Postscript_Name(sfont->ft_face); + namelen = strlen(name); + if (namelen > destlen - 1) { + strncpy(dest, name, destlen - 1); + dest[destlen] = 0; + } + else + strcpy(dest, name); + +#else + /* First try Mac-Roman PS name and then Win-Unicode PS name */ if ((namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0, 6)) != 0 || (namelen = tt_get_name(sfont, dest, destlen, 3, 1, 0x409u, 6)) != 0 || @@ -492,5 +501,7 @@ tt_get_ps_fontname (sfnt *sfont, char *dest, USHORT destlen) namelen = tt_get_name(sfont, dest, destlen, 1, 0, 0, 1); } +#endif + return namelen; } diff --git a/Build/source/texk/dvipdfm-x/src/type0.h b/Build/source/texk/dvipdfm-x/src/type0.h deleted file mode 100644 index da22c8085d7..00000000000 --- a/Build/source/texk/dvipdfm-x/src/type0.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _TYPE0_H_ -#define _TYPE0_H_ - -#include "pdfobj.h" - -#define add_to_used_chars2(b,c) {(b)[(c)/8] |= (1 << (7-((c)%8)));} -#define is_used_char2(b,c) (((b)[(c)/8]) & (1 << (7-((c)%8)))) - -typedef struct Type0Font Type0Font; - -extern void Type0Font_set_verbose (void); - -extern int Type0Font_get_wmode (Type0Font *font); -#if 0 -extern char *Type0Font_get_encoding (Type0Font *font); -#endif -extern char *Type0Font_get_usedchars (Type0Font *font); - -extern pdf_obj *Type0Font_get_resource (Type0Font *font); - -extern void Type0Font_set_ToUnicode (Type0Font *font, pdf_obj *cmap_ref); - -#include "fontmap.h" -extern int pdf_font_findfont0 (const char *font_name, - int cmap_id, fontmap_opt *fmap_opt); - -/******************************** CACHE ********************************/ - -extern void Type0Font_cache_init (void); -extern Type0Font *Type0Font_cache_get (int id); -extern int Type0Font_cache_find (const char *map_name, int cmap_id, fontmap_opt *fmap_opt); -extern void Type0Font_cache_close (void); - -#endif /* _TYPE0_H_ */ diff --git a/Build/source/texk/dvipdfm-x/src/vf.c b/Build/source/texk/dvipdfm-x/src/vf.c deleted file mode 100644 index fa40ae9954a..00000000000 --- a/Build/source/texk/dvipdfm-x/src/vf.c +++ /dev/null @@ -1,1058 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "system.h" -#include "numbers.h" -#include "error.h" -#include "mem.h" - -#include "dpxfile.h" -/* pdfdev... */ -#include "pdfdev.h" - -#include "tfm.h" -#include "dvi.h" -#include "vf.h" - -#include "dvicodes.h" - -#define VF_ALLOC_SIZE 16u - -#define VF_ID 202 -#define FIX_WORD_BASE 1048576.0 -#define TEXPT2PT (72.0/72.27) -#define FW2PT (TEXPT2PT/((double)(FIX_WORD_BASE))) - -static unsigned char verbose = 0; - -void vf_set_verbose(void) -{ - if (verbose < 255) verbose++; -} - -struct font_def { - signed long font_id /* id used internally in vf file */; - unsigned long checksum, size, design_size; - char *directory, *name; - int tfm_id; /* id returned by TFM module */ - int dev_id; /* id returned by DEV module */ -}; - -struct vf -{ - char *tex_name; - spt_t ptsize; - unsigned long design_size; /* A fixword-pts quantity */ - int num_dev_fonts, max_dev_fonts; - struct font_def *dev_fonts; - unsigned char **ch_pkt; - unsigned long *pkt_len; - unsigned num_chars; -}; - -struct vf *vf_fonts = NULL; -int num_vf_fonts = 0, max_vf_fonts = 0; - -static int read_header(FILE *vf_file, int thisfont) -{ - int i, result = 1, ch; - - /* Check for usual signature */ - if ((ch = get_unsigned_byte (vf_file)) == PRE && - (ch = get_unsigned_byte (vf_file)) == VF_ID) { - - /* If here, assume it's a legitimate vf file */ - ch = get_unsigned_byte (vf_file); - - /* skip comment */ - for (i=0; i max_vf_fonts) { - vf_fonts = RENEW (vf_fonts, size, struct vf); - for (i=max_vf_fonts; i (a_vf->num_chars)) { - size = MAX (size, a_vf->num_chars+256); - a_vf->ch_pkt = RENEW (a_vf->ch_pkt, size, unsigned char *); - a_vf->pkt_len = RENEW (a_vf->pkt_len, size, unsigned long); - for (i=a_vf->num_chars; ich_pkt)[i] = NULL; - (a_vf->pkt_len)[i] = 0; - } - a_vf->num_chars = size; - } -} - -static void read_a_char_def(FILE *vf_file, int thisfont, unsigned long pkt_len, - unsigned ch) -{ - unsigned char *pkt; -#ifdef DEBUG - fprintf (stderr, "read_a_char_def: len=%ld, ch=%d\n", pkt_len, ch); -#endif - /* Resize and initialize character arrays if necessary */ - if (ch >= vf_fonts[thisfont].num_chars) { - resize_one_vf_font (vf_fonts+thisfont, ch+1); - } - if (pkt_len > 0) { - pkt = NEW (pkt_len, unsigned char); - if (fread (pkt, 1, pkt_len, vf_file) != pkt_len) - ERROR ("VF file ended prematurely."); - (vf_fonts[thisfont].ch_pkt)[ch] = pkt; - } - (vf_fonts[thisfont].pkt_len)[ch] = pkt_len; - return; -} - -static void read_a_font_def(FILE *vf_file, signed long font_id, int thisfont) -{ - struct font_def *dev_font; - int dir_length, name_length; -#ifdef DEBUG - fprintf (stderr, "read_a_font_def: font_id = %ld\n", font_id); -#endif - if (vf_fonts[thisfont].num_dev_fonts >= - vf_fonts[thisfont].max_dev_fonts) { - vf_fonts[thisfont].max_dev_fonts += VF_ALLOC_SIZE; - vf_fonts[thisfont].dev_fonts = RENEW - (vf_fonts[thisfont].dev_fonts, - vf_fonts[thisfont].max_dev_fonts, - struct font_def); - } - dev_font = vf_fonts[thisfont].dev_fonts+ - vf_fonts[thisfont].num_dev_fonts; - dev_font -> font_id = font_id; - dev_font -> checksum = get_unsigned_quad (vf_file); - dev_font -> size = get_unsigned_quad (vf_file); - dev_font -> design_size = get_unsigned_quad (vf_file); - dir_length = get_unsigned_byte (vf_file); - name_length = get_unsigned_byte (vf_file); - dev_font -> directory = NEW (dir_length+1, char); - dev_font -> name = NEW (name_length+1, char); - fread (dev_font -> directory, 1, dir_length, vf_file); - fread (dev_font -> name, 1, name_length, vf_file); - (dev_font -> directory)[dir_length] = 0; - (dev_font -> name)[name_length] = 0; - vf_fonts[thisfont].num_dev_fonts += 1; - dev_font->tfm_id = tfm_open (dev_font -> name, 1); /* must exist */ - dev_font->dev_id = - dvi_locate_font (dev_font->name, - sqxfw (vf_fonts[thisfont].ptsize, - dev_font->size)); -#ifdef DEBUG - fprintf (stderr, "[%s/%s]\n", dev_font -> directory, dev_font -> name); -#endif - return; -} - - -static void process_vf_file (FILE *vf_file, int thisfont) -{ - int eof = 0, code; - unsigned long font_id; - while (!eof) { - code = get_unsigned_byte (vf_file); - switch (code) { - case FNT_DEF1: - font_id = get_unsigned_byte (vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - case FNT_DEF2: - font_id = get_unsigned_pair (vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - case FNT_DEF3: - font_id = get_unsigned_triple(vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - case FNT_DEF4: - font_id = get_signed_quad(vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - default: - if (code < 242) { - long ch; - /* For a short packet, code is the pkt_len */ - ch = get_unsigned_byte (vf_file); - /* Skip over TFM width since we already know it */ - get_unsigned_triple (vf_file); - read_a_char_def (vf_file, thisfont, code, ch); - break; - } - if (code == 242) { - unsigned long pkt_len, ch; - pkt_len = get_unsigned_quad(vf_file); - ch = get_unsigned_quad (vf_file); - /* Skip over TFM width since we already know it */ - get_unsigned_quad (vf_file); - if (ch < 0x1000000L) - read_a_char_def (vf_file, thisfont, pkt_len, ch); - else { - fprintf (stderr, "char=%ld\n", ch); - ERROR ("Long character (>24 bits) in VF file.\nI can't handle long characters!\n"); - } - break; - } - if (code == POST) { - eof = 1; - break; - } - fprintf (stderr, "Quitting on code=%d\n", code); - eof = 1; - break; - } - } - return; -} - -/* Unfortunately, the following code isn't smart enough - to load the vf only once for multiple point sizes. - You will get a separate copy of each VF in memory (and a separate - opening and reading of the file) for - each point size. Since VFs are pretty small, I guess - this is tolerable for now. In any case, - the PDF file will never repeat a physical font name */ -/* Note: This code needs to be able to recurse */ -/* Global variables such as num_vf_fonts require careful attention */ -int vf_locate_font (const char *tex_name, spt_t ptsize) -{ - int thisfont = -1, i; - char *full_vf_file_name; - FILE *vf_file; - /* Has this name and ptsize already been loaded as a VF? */ - for (i=0; i 1) - fprintf (stderr, "(VF:%s", full_vf_file_name); - if (num_vf_fonts >= max_vf_fonts) { - resize_vf_fonts (max_vf_fonts + VF_ALLOC_SIZE); - } - thisfont = num_vf_fonts++; - { /* Initialize some pointers and such */ - vf_fonts[thisfont].tex_name = NEW (strlen(tex_name)+1, char); - strcpy (vf_fonts[thisfont].tex_name, tex_name); - vf_fonts[thisfont].ptsize = ptsize; - vf_fonts[thisfont].num_chars = 0; - vf_fonts[thisfont].ch_pkt = NULL; - vf_fonts[thisfont].pkt_len = NULL; - } - read_header(vf_file, thisfont); - process_vf_file (vf_file, thisfont); - if (verbose) - fprintf (stderr, ")"); - MFCLOSE (vf_file); - } - if (full_vf_file_name) - RELEASE(full_vf_file_name); - } - return thisfont; -} - -#define next_byte() (*((*start)++)) -static UNSIGNED_BYTE unsigned_byte (unsigned char **start, unsigned char *end) -{ - UNSIGNED_BYTE byte = 0; - if (*start < end) - byte = next_byte(); - else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return byte; -} - -static SIGNED_BYTE signed_byte (unsigned char **start, unsigned char *end) -{ - int byte = 0; - if (*start < end) { - byte = next_byte(); - if (byte >= 0x80) - byte -= 0x100; - } - else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_BYTE) byte; -} - -static UNSIGNED_PAIR unsigned_pair (unsigned char **start, unsigned char *end) -{ - int i; - UNSIGNED_BYTE byte; - UNSIGNED_PAIR pair = 0; - if (end-*start > 1) { - for (i=0; i<2; i++) { - byte = next_byte(); - pair = pair*0x100u + byte; - } - } - else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return pair; -} - -static SIGNED_PAIR signed_pair (unsigned char **start, unsigned char *end) -{ - int i; - long pair = 0; - if (end - *start > 1) { - for (i=0; i<2; i++) { - pair = pair*0x100 + next_byte(); - } - if (pair >= 0x8000) { - pair -= 0x10000l; - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_PAIR) pair; -} - -static UNSIGNED_TRIPLE unsigned_triple(unsigned char **start, unsigned - char *end) -{ - int i; - long triple = 0; - if (end-*start > 2) { - for (i=0; i<3; i++) { - triple = triple*0x100u + next_byte(); - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (UNSIGNED_TRIPLE) triple; -} - -static SIGNED_TRIPLE signed_triple(unsigned char **start, unsigned char *end) -{ - int i; - long triple = 0; - if (end-*start > 2) { - for (i=0; i<3; i++) { - triple = triple*0x100 + next_byte(); - } - if (triple >= 0x800000l) - triple -= 0x1000000l; - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_TRIPLE) triple; -} - -static SIGNED_QUAD signed_quad(unsigned char **start, unsigned char *end) -{ - int byte, i; - long quad = 0; - /* Check sign on first byte before reading others */ - if (end-*start > 3) { - byte = next_byte(); - quad = byte; - if (quad >= 0x80) - quad = byte - 0x100; - for (i=0; i<3; i++) { - quad = quad*0x100 + next_byte(); - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_QUAD) quad; -} - -static UNSIGNED_QUAD unsigned_quad(unsigned char **start, unsigned char *end) -{ - int i; - unsigned long quad = 0; - if (end-*start > 3) { - for (i=0; i<4; i++) { - quad = quad*0x100u + next_byte(); - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (UNSIGNED_QUAD) quad; -} - -static void vf_set (SIGNED_QUAD ch) -{ - /* Defer to the dvi_set() defined in dvi.c */ - dvi_set (ch); - return; -} - -static void vf_set1(unsigned char **start, unsigned char *end) -{ - vf_set (unsigned_byte(start, end)); - return; -} - -static void vf_set2(unsigned char **start, unsigned char *end) -{ - vf_set (unsigned_pair(start, end)); - return; -} - -static void vf_set3(unsigned char **start, unsigned char *end) -{ - vf_set (unsigned_triple(start, end)); - return; -} - -static void vf_putrule(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - SIGNED_QUAD width, height; - height = signed_quad (start, end); - width = signed_quad (start, end); - if (width > 0 && height > 0) { - dvi_rule (sqxfw(ptsize,width), sqxfw(ptsize, height)); - } - return; -} - -static void vf_setrule(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - SIGNED_QUAD width, height, s_width; - height = signed_quad (start, end); - width = signed_quad (start, end); - s_width = sqxfw(ptsize, width); - if (width > 0 && height > 0) { - dvi_rule (s_width, sqxfw(ptsize, height)); - } - dvi_right (s_width); - return; -} - -static void vf_put1(unsigned char **start, unsigned char *end) -{ - dvi_put (unsigned_byte(start, end)); - return; -} - -static void vf_put2(unsigned char **start, unsigned char *end) -{ - dvi_put (unsigned_pair(start, end)); - return; -} - -static void vf_put3(unsigned char **start, unsigned char *end) -{ - dvi_put (unsigned_triple(start, end)); - return; -} - -static void vf_push(void) -{ - dvi_push(); - return; -} - -static void vf_pop(void) -{ - dvi_pop(); - return; -} - -static void vf_right (SIGNED_QUAD x, spt_t ptsize) -{ - dvi_right ((SIGNED_QUAD) (sqxfw(ptsize, x))); - return; -} - - -static void vf_right1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_byte (start, end), ptsize); - return; -} - -static void vf_right2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_pair (start, end), ptsize); - return; -} - -static void vf_right3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_triple (start, end), ptsize); - return; -} - -static void vf_right4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_quad (start, end), ptsize); - return; -} - -static void vf_w0(void) -{ - dvi_w0(); - return; -} - -static void vf_w (SIGNED_QUAD w, spt_t ptsize) -{ - dvi_w ((SIGNED_QUAD) (sqxfw(ptsize, w))); - return; -} - -static void vf_w1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_byte(start, end), ptsize); - return; -} - -static void vf_w2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_pair(start, end), ptsize); - return; -} - -static void vf_w3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_triple(start, end), ptsize); - return; -} - -static void vf_w4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_quad(start, end), ptsize); - return; -} - -static void vf_x0(void) -{ - dvi_x0(); - return; -} - -static void vf_x (SIGNED_QUAD x, spt_t ptsize) -{ - dvi_x ((SIGNED_QUAD) (sqxfw(ptsize, x))); - return; -} - -static void vf_x1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_byte(start, end), ptsize); - return; -} - -static void vf_x2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_pair(start, end), ptsize); - return; -} - -static void vf_x3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_triple(start, end), ptsize); - return; -} - -static void vf_x4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_quad(start, end), ptsize); - return; -} - -static void vf_down (SIGNED_QUAD y, spt_t ptsize) -{ - dvi_down ((SIGNED_QUAD) (sqxfw(ptsize, y))); - return; -} - -static void vf_down1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_byte(start, end), ptsize); - return; -} - -static void vf_down2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_pair(start, end), ptsize); - return; -} - -static void vf_down3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_triple(start, end), ptsize); - return; -} - -static void vf_down4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_quad(start, end), ptsize); - return; -} - -static void vf_y0(void) -{ - dvi_y0(); - return; -} - -static void vf_y (SIGNED_QUAD y, spt_t ptsize) -{ - dvi_y ((SIGNED_QUAD) (sqxfw(ptsize, y))); - return; -} - - -static void vf_y1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_byte(start, end), ptsize); - return; -} - -static void vf_y2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_pair(start, end), ptsize); - return; -} - -static void vf_y3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_triple(start, end), ptsize); - return; -} - -static void vf_y4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_quad(start, end), ptsize); - return; -} - -static void vf_z0(void) -{ - dvi_z0(); - return; -} - -static void vf_z (SIGNED_QUAD z, spt_t ptsize) -{ - dvi_z ((SIGNED_QUAD) (sqxfw(ptsize, z))); - return; -} - -static void vf_z1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_byte(start, end), ptsize); - return; -} - -static void vf_z2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_pair(start, end), ptsize); - return; -} - -static void vf_z3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_triple(start, end), ptsize); - return; -} - -static void vf_z4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_quad(start, end), ptsize); - return; -} - -static void vf_fnt (SIGNED_QUAD font_id, unsigned long vf_font) -{ - int i; - for (i=0; i 0) - default_font = ((vf_fonts[vf_font].dev_fonts)[0]).dev_id; - dvi_vf_init (default_font); - if (ch >= vf_fonts[vf_font].num_chars || - !(start = (vf_fonts[vf_font].ch_pkt)[ch])) { - fprintf (stderr, "\nchar=0x%lx(%ld)\n", ch, ch); - fprintf (stderr, "Tried to set a nonexistent character in a virtual font"); - start = end = NULL; - } else { - end = start + (vf_fonts[vf_font].pkt_len)[ch]; - } - while (start && start < end) { - opcode = *(start++); -#ifdef DEBUG - fprintf (stderr, "VF opcode: %d", opcode); - if (isprint (opcode)) fprintf (stderr, " (\'%c\')\n", opcode); - else fprintf (stderr, "\n"); -#endif - switch (opcode) - { - case SET1: - vf_set1(&start, end); - break; - case SET2: - vf_set2(&start, end); - break; - case SET3: - vf_set3(&start, end); - break; - case SET4: - ERROR ("Multibyte (>24 bits) character in VF packet.\nI can't handle this!"); - break; - case SET_RULE: - vf_setrule(&start, end, ptsize); - break; - case PUT1: - vf_put1(&start, end); - break; - case PUT2: - vf_put2(&start, end); - break; - case PUT3: - vf_put3(&start, end); - break; - case PUT4: - ERROR ("Multibyte (>24 bits) character in VF packet.\nI can't handle this!"); - break; - case PUT_RULE: - vf_putrule(&start, end, ptsize); - break; - case NOP: - break; - case PUSH: - vf_push(); - break; - case POP: - vf_pop(); - break; - case RIGHT1: - vf_right1(&start, end, ptsize); - break; - case RIGHT2: - vf_right2(&start, end, ptsize); - break; - case RIGHT3: - vf_right3(&start, end, ptsize); - break; - case RIGHT4: - vf_right4(&start, end, ptsize); - break; - case W0: - vf_w0(); - break; - case W1: - vf_w1(&start, end, ptsize); - break; - case W2: - vf_w2(&start, end, ptsize); - break; - case W3: - vf_w3(&start, end, ptsize); - break; - case W4: - vf_w4(&start, end, ptsize); - break; - case X0: - vf_x0(); - break; - case X1: - vf_x1(&start, end, ptsize); - break; - case X2: - vf_x2(&start, end, ptsize); - break; - case X3: - vf_x3(&start, end, ptsize); - break; - case X4: - vf_x4(&start, end, ptsize); - break; - case DOWN1: - vf_down1(&start, end, ptsize); - break; - case DOWN2: - vf_down2(&start, end, ptsize); - break; - case DOWN3: - vf_down3(&start, end, ptsize); - break; - case DOWN4: - vf_down4(&start, end, ptsize); - break; - case Y0: - vf_y0(); - break; - case Y1: - vf_y1(&start, end, ptsize); - break; - case Y2: - vf_y2(&start, end, ptsize); - break; - case Y3: - vf_y3(&start, end, ptsize); - break; - case Y4: - vf_y4(&start, end, ptsize); - break; - case Z0: - vf_z0(); - break; - case Z1: - vf_z1(&start, end, ptsize); - break; - case Z2: - vf_z2(&start, end, ptsize); - break; - case Z3: - vf_z3(&start, end, ptsize); - break; - case Z4: - vf_z4(&start, end, ptsize); - break; - case FNT1: - vf_fnt1(&start, end, vf_font); - break; - case FNT2: - vf_fnt2(&start, end, vf_font); - break; - case FNT3: - vf_fnt3(&start, end, vf_font); - break; - case FNT4: - vf_fnt4(&start, end, vf_font); - break; - case XXX1: - vf_xxx1(&start, end); - break; - case XXX2: - vf_xxx2(&start, end); - break; - case XXX3: - vf_xxx3(&start, end); - break; - case XXX4: - vf_xxx4(&start, end); - break; - case PTEXDIR: - vf_dir(&start, end); - break; - default: - if (opcode <= SET_CHAR_127) { - vf_set (opcode); - } else if (opcode >= FNT_NUM_0 && opcode <= FNT_NUM_63) { - vf_fnt (opcode - FNT_NUM_0, vf_font); - } else { - fprintf (stderr, "Unexpected opcode: %d\n", opcode); - ERROR ("Unexpected opcode in vf file\n"); - } - } - } - dvi_vf_finish(); - } else { - fprintf (stderr, "vf_set_char: font: %d", vf_font); - ERROR ("Font not loaded\n"); - } - return; -} - - -void vf_close_all_fonts(void) -{ - unsigned long i; - int j; - struct font_def *one_font; - for (i=0; i directory); - RELEASE (one_font -> name); - } - if (vf_fonts[i].dev_fonts != NULL) - RELEASE (vf_fonts[i].dev_fonts); - } - if (vf_fonts != NULL) - RELEASE (vf_fonts); - return; -} diff --git a/Build/source/texk/dvipdfm-x/src/xbb.c b/Build/source/texk/dvipdfm-x/src/xbb.c index 121ffab89c6..c074ef40cff 100644 --- a/Build/source/texk/dvipdfm-x/src/xbb.c +++ b/Build/source/texk/dvipdfm-x/src/xbb.c @@ -2,7 +2,7 @@ This is extractbb, a bounding box extraction program. - Copyright (C) 2009-2012 by Jin-Hwan Cho and Matthias Franz + Copyright (C) 2008-2012 by Jin-Hwan Cho and Matthias Franz This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -242,7 +242,7 @@ static void do_pdf (FILE *fp, char *filename) pdf_file_get_version(pf), count); } -int extractbb (int argc, char *argv[]) +int extractbb (int argc, char *argv[], int mode) { pdf_files_init(); diff --git a/Build/source/texk/dvipdfm-x/src/xbb.h b/Build/source/texk/dvipdfm-x/src/xbb.h deleted file mode 100644 index c4390e1cb09..00000000000 --- a/Build/source/texk/dvipdfm-x/src/xbb.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2008-2012 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, - the dvipdfmx project team. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _XBB_H_ -#define _XBB_H_ - -#define EBB_OUTPUT 0 -#define XBB_OUTPUT 1 - -extern int extractbb(int argc, char *argv[]); - -#endif /* _XBB_H_ */ diff --git a/Build/source/texk/dvipdfm-x/tt_cmap.h b/Build/source/texk/dvipdfm-x/tt_cmap.h new file mode 100644 index 00000000000..afe06b34f0e --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tt_cmap.h @@ -0,0 +1,82 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _TT_CMAP_H_ +#define _TT_CMAP_H_ + +#include "sfnt.h" + +extern void otf_cmap_set_verbose (void); + +/* TrueType cmap table */ +typedef struct +{ + USHORT format; + USHORT platform; + USHORT encoding; + ULONG language; /* or version, only for Mac */ + void *map; +} tt_cmap; + +/* Paltform ID */ +#define TT_MAC 1u +#define TT_WIN 3u + +/* Platform-specific encoding ID */ + +/* Windows */ +#define TT_WIN_SYMBOL 0u +#define TT_WIN_UNICODE 1u +#define TT_WIN_SJIS 2u +#define TT_WIN_RPC 3u +#define TT_WIN_BIG5 4u +#define TT_WIN_WANSUNG 5u +#define TT_WIN_JOHAB 6u +#define TT_WIN_UCS4 10u + +/* Mac */ +#define TT_MAC_ROMAN 0u +#define TT_MAC_JAPANESE 1u +#define TT_MAC_TRADITIONAL_CHINESE 2u +#define TT_MAC_KOREAN 3u +#define TT_MAC_SIMPLIFIED_CHINESE 25u + +extern tt_cmap *tt_cmap_read (sfnt *sfont, USHORT platform, USHORT encoding); + +extern USHORT tt_cmap_lookup (tt_cmap *cmap, long cc); +extern void tt_cmap_release (tt_cmap *cmap); + +#include "pdfobj.h" + +/* Indirect reference */ +extern pdf_obj *otf_create_ToUnicode_stream (const char *map_name, + int ttc_index, +#ifdef XETEX + FT_Face face, +#endif + const char *used_glyphs); +/* CMap ID */ +extern int otf_load_Unicode_CMap (const char *map_name, + int ttc_index, + const char *otl_opts, int wmode); + +#endif /* _TT_CMAP_H_ */ diff --git a/Build/source/texk/dvipdfm-x/type0.h b/Build/source/texk/dvipdfm-x/type0.h new file mode 100644 index 00000000000..023b7c942bd --- /dev/null +++ b/Build/source/texk/dvipdfm-x/type0.h @@ -0,0 +1,60 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _TYPE0_H_ +#define _TYPE0_H_ + +#include "pdfobj.h" + +#define add_to_used_chars2(b,c) {(b)[(c)/8] |= (1 << (7-((c)%8)));} +#define is_used_char2(b,c) (((b)[(c)/8]) & (1 << (7-((c)%8)))) + +typedef struct Type0Font Type0Font; + +extern void Type0Font_set_verbose (void); + +extern int Type0Font_get_wmode (Type0Font *font); +#if 0 +extern char *Type0Font_get_encoding (Type0Font *font); +#endif +extern char *Type0Font_get_usedchars (Type0Font *font); + +extern pdf_obj *Type0Font_get_resource (Type0Font *font); + +extern void Type0Font_set_ToUnicode (Type0Font *font, pdf_obj *cmap_ref); + +#include "fontmap.h" +extern int pdf_font_findfont0 (const char *font_name, + int cmap_id, fontmap_opt *fmap_opt); + +#ifdef XETEX +extern unsigned short *Type0Font_get_ft_to_gid(int id); +#endif + +/******************************** CACHE ********************************/ + +extern void Type0Font_cache_init (void); +extern Type0Font *Type0Font_cache_get (int id); +extern int Type0Font_cache_find (const char *map_name, int cmap_id, fontmap_opt *fmap_opt); +extern void Type0Font_cache_close (void); + +#endif /* _TYPE0_H_ */ diff --git a/Build/source/texk/dvipdfm-x/vf.c b/Build/source/texk/dvipdfm-x/vf.c new file mode 100644 index 00000000000..b1f6b1d471b --- /dev/null +++ b/Build/source/texk/dvipdfm-x/vf.c @@ -0,0 +1,1075 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, + the dvipdfmx project team. + + Copyright (C) 1998, 1999 by Mark A. Wicks + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "system.h" +#include "numbers.h" +#include "error.h" +#include "mem.h" + +#include "dpxfile.h" +/* pdfdev... */ +#include "pdfdev.h" + +#include "tfm.h" +#include "dvi.h" +#include "vf.h" + +#include "dvicodes.h" + +#define VF_ALLOC_SIZE 16u + +#define VF_ID 202 +#define FIX_WORD_BASE 1048576.0 +#define TEXPT2PT (72.0/72.27) +#define FW2PT (TEXPT2PT/((double)(FIX_WORD_BASE))) + +static unsigned char verbose = 0; + +void vf_set_verbose(void) +{ + if (verbose < 255) verbose++; +} + +struct font_def { + signed long font_id /* id used internally in vf file */; + unsigned long checksum, size, design_size; + char *directory, *name; + int tfm_id; /* id returned by TFM module */ + int dev_id; /* id returned by DEV module */ +}; + +struct vf +{ + char *tex_name; + spt_t ptsize; + unsigned long design_size; /* A fixword-pts quantity */ + int num_dev_fonts, max_dev_fonts; + struct font_def *dev_fonts; + unsigned char **ch_pkt; + unsigned long *pkt_len; + unsigned num_chars; +}; + +struct vf *vf_fonts = NULL; +int num_vf_fonts = 0, max_vf_fonts = 0; + +static int read_header(FILE *vf_file, int thisfont) +{ + int i, result = 1, ch; + + /* Check for usual signature */ + if ((ch = get_unsigned_byte (vf_file)) == PRE && + (ch = get_unsigned_byte (vf_file)) == VF_ID) { + + /* If here, assume it's a legitimate vf file */ + ch = get_unsigned_byte (vf_file); + + /* skip comment */ + for (i=0; i max_vf_fonts) { + vf_fonts = RENEW (vf_fonts, size, struct vf); + for (i=max_vf_fonts; i (a_vf->num_chars)) { + size = MAX (size, a_vf->num_chars+256); + a_vf->ch_pkt = RENEW (a_vf->ch_pkt, size, unsigned char *); + a_vf->pkt_len = RENEW (a_vf->pkt_len, size, unsigned long); + for (i=a_vf->num_chars; ich_pkt)[i] = NULL; + (a_vf->pkt_len)[i] = 0; + } + a_vf->num_chars = size; + } +} + +static void read_a_char_def(FILE *vf_file, int thisfont, unsigned long pkt_len, + unsigned ch) +{ + unsigned char *pkt; +#ifdef DEBUG + fprintf (stderr, "read_a_char_def: len=%ld, ch=%d\n", pkt_len, ch); +#endif + /* Resize and initialize character arrays if necessary */ + if (ch >= vf_fonts[thisfont].num_chars) { + resize_one_vf_font (vf_fonts+thisfont, ch+1); + } + if (pkt_len > 0) { + pkt = NEW (pkt_len, unsigned char); + if (fread (pkt, 1, pkt_len, vf_file) != pkt_len) + ERROR ("VF file ended prematurely."); + (vf_fonts[thisfont].ch_pkt)[ch] = pkt; + } + (vf_fonts[thisfont].pkt_len)[ch] = pkt_len; + return; +} + +static void read_a_font_def(FILE *vf_file, signed long font_id, int thisfont) +{ + struct font_def *dev_font; + int dir_length, name_length; +#ifdef DEBUG + fprintf (stderr, "read_a_font_def: font_id = %ld\n", font_id); +#endif + if (vf_fonts[thisfont].num_dev_fonts >= + vf_fonts[thisfont].max_dev_fonts) { + vf_fonts[thisfont].max_dev_fonts += VF_ALLOC_SIZE; + vf_fonts[thisfont].dev_fonts = RENEW + (vf_fonts[thisfont].dev_fonts, + vf_fonts[thisfont].max_dev_fonts, + struct font_def); + } + dev_font = vf_fonts[thisfont].dev_fonts+ + vf_fonts[thisfont].num_dev_fonts; + dev_font -> font_id = font_id; + dev_font -> checksum = get_unsigned_quad (vf_file); + dev_font -> size = get_unsigned_quad (vf_file); + dev_font -> design_size = get_unsigned_quad (vf_file); + dir_length = get_unsigned_byte (vf_file); + name_length = get_unsigned_byte (vf_file); + dev_font -> directory = NEW (dir_length+1, char); + dev_font -> name = NEW (name_length+1, char); + fread (dev_font -> directory, 1, dir_length, vf_file); + fread (dev_font -> name, 1, name_length, vf_file); + (dev_font -> directory)[dir_length] = 0; + (dev_font -> name)[name_length] = 0; + vf_fonts[thisfont].num_dev_fonts += 1; + dev_font->tfm_id = tfm_open (dev_font -> name, 1); /* must exist */ + dev_font->dev_id = + dvi_locate_font (dev_font->name, + sqxfw (vf_fonts[thisfont].ptsize, + dev_font->size)); +#ifdef DEBUG + fprintf (stderr, "[%s/%s]\n", dev_font -> directory, dev_font -> name); +#endif + return; +} + +#ifdef XETEX +#define MAX_BITS 16 +#else +#define MAX_BITS 24 +#endif + + +static void process_vf_file (FILE *vf_file, int thisfont) +{ + int eof = 0, code; + unsigned long font_id; + while (!eof) { + code = get_unsigned_byte (vf_file); + switch (code) { + case FNT_DEF1: + font_id = get_unsigned_byte (vf_file); + read_a_font_def (vf_file, font_id, thisfont); + break; + case FNT_DEF2: + font_id = get_unsigned_pair (vf_file); + read_a_font_def (vf_file, font_id, thisfont); + break; + case FNT_DEF3: + font_id = get_unsigned_triple(vf_file); + read_a_font_def (vf_file, font_id, thisfont); + break; + case FNT_DEF4: + font_id = get_signed_quad(vf_file); + read_a_font_def (vf_file, font_id, thisfont); + break; + default: + if (code < 242) { + long ch; + /* For a short packet, code is the pkt_len */ + ch = get_unsigned_byte (vf_file); + /* Skip over TFM width since we already know it */ + get_unsigned_triple (vf_file); + read_a_char_def (vf_file, thisfont, code, ch); + break; + } + if (code == 242) { + unsigned long pkt_len, ch; + pkt_len = get_unsigned_quad(vf_file); + ch = get_unsigned_quad (vf_file); + /* Skip over TFM width since we already know it */ + get_unsigned_quad (vf_file); + if (ch < (1UL << MAX_BITS)) + read_a_char_def (vf_file, thisfont, pkt_len, ch); + else { + fprintf (stderr, "char=%ld\n", ch); + ERROR ("Long character (>%d bits) in VF file.\nI can't handle long characters!\n", + MAX_BITS); + } + break; + } + if (code == POST) { + eof = 1; + break; + } + fprintf (stderr, "Quitting on code=%d\n", code); + eof = 1; + break; + } + } + return; +} + +/* Unfortunately, the following code isn't smart enough + to load the vf only once for multiple point sizes. + You will get a separate copy of each VF in memory (and a separate + opening and reading of the file) for + each point size. Since VFs are pretty small, I guess + this is tolerable for now. In any case, + the PDF file will never repeat a physical font name */ +/* Note: This code needs to be able to recurse */ +/* Global variables such as num_vf_fonts require careful attention */ +int vf_locate_font (const char *tex_name, spt_t ptsize) +{ + int thisfont = -1, i; + char *full_vf_file_name; + FILE *vf_file; + /* Has this name and ptsize already been loaded as a VF? */ + for (i=0; i 1) + fprintf (stderr, "(VF:%s", full_vf_file_name); + if (num_vf_fonts >= max_vf_fonts) { + resize_vf_fonts (max_vf_fonts + VF_ALLOC_SIZE); + } + thisfont = num_vf_fonts++; + { /* Initialize some pointers and such */ + vf_fonts[thisfont].tex_name = NEW (strlen(tex_name)+1, char); + strcpy (vf_fonts[thisfont].tex_name, tex_name); + vf_fonts[thisfont].ptsize = ptsize; + vf_fonts[thisfont].num_chars = 0; + vf_fonts[thisfont].ch_pkt = NULL; + vf_fonts[thisfont].pkt_len = NULL; + } + read_header(vf_file, thisfont); + process_vf_file (vf_file, thisfont); + if (verbose) + fprintf (stderr, ")"); + MFCLOSE (vf_file); + } + if (full_vf_file_name) + RELEASE(full_vf_file_name); + } + return thisfont; +} + +#define next_byte() (*((*start)++)) +static UNSIGNED_BYTE unsigned_byte (unsigned char **start, unsigned char *end) +{ + UNSIGNED_BYTE byte = 0; + if (*start < end) + byte = next_byte(); + else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return byte; +} + +static SIGNED_BYTE signed_byte (unsigned char **start, unsigned char *end) +{ + int byte = 0; + if (*start < end) { + byte = next_byte(); + if (byte >= 0x80) + byte -= 0x100; + } + else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return (SIGNED_BYTE) byte; +} + +static UNSIGNED_PAIR unsigned_pair (unsigned char **start, unsigned char *end) +{ + int i; + UNSIGNED_BYTE byte; + UNSIGNED_PAIR pair = 0; + if (end-*start > 1) { + for (i=0; i<2; i++) { + byte = next_byte(); + pair = pair*0x100u + byte; + } + } + else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return pair; +} + +static SIGNED_PAIR signed_pair (unsigned char **start, unsigned char *end) +{ + int i; + long pair = 0; + if (end - *start > 1) { + for (i=0; i<2; i++) { + pair = pair*0x100 + next_byte(); + } + if (pair >= 0x8000) { + pair -= 0x10000l; + } + } else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return (SIGNED_PAIR) pair; +} + +static UNSIGNED_TRIPLE unsigned_triple(unsigned char **start, unsigned + char *end) +{ + int i; + long triple = 0; + if (end-*start > 2) { + for (i=0; i<3; i++) { + triple = triple*0x100u + next_byte(); + } + } else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return (UNSIGNED_TRIPLE) triple; +} + +static SIGNED_TRIPLE signed_triple(unsigned char **start, unsigned char *end) +{ + int i; + long triple = 0; + if (end-*start > 2) { + for (i=0; i<3; i++) { + triple = triple*0x100 + next_byte(); + } + if (triple >= 0x800000l) + triple -= 0x1000000l; + } else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return (SIGNED_TRIPLE) triple; +} + +static SIGNED_QUAD signed_quad(unsigned char **start, unsigned char *end) +{ + int byte, i; + long quad = 0; + /* Check sign on first byte before reading others */ + if (end-*start > 3) { + byte = next_byte(); + quad = byte; + if (quad >= 0x80) + quad = byte - 0x100; + for (i=0; i<3; i++) { + quad = quad*0x100 + next_byte(); + } + } else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return (SIGNED_QUAD) quad; +} + +static UNSIGNED_QUAD unsigned_quad(unsigned char **start, unsigned char *end) +{ + int i; + unsigned long quad = 0; + if (end-*start > 3) { + for (i=0; i<4; i++) { + quad = quad*0x100u + next_byte(); + } + } else + ERROR ("Premature end of DVI byte stream in VF font\n"); + return (UNSIGNED_QUAD) quad; +} + +static void vf_set (SIGNED_QUAD ch) +{ + /* Defer to the dvi_set() defined in dvi.c */ + dvi_set (ch); + return; +} + +static void vf_set1(unsigned char **start, unsigned char *end) +{ + vf_set (unsigned_byte(start, end)); + return; +} + +static void vf_set2(unsigned char **start, unsigned char *end) +{ + vf_set (unsigned_pair(start, end)); + return; +} + +#ifndef XETEX +static void vf_set3(unsigned char **start, unsigned char *end) +{ + vf_set (unsigned_triple(start, end)); + return; +} +#endif + +static void vf_putrule(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + SIGNED_QUAD width, height; + height = signed_quad (start, end); + width = signed_quad (start, end); + if (width > 0 && height > 0) { + dvi_rule (sqxfw(ptsize,width), sqxfw(ptsize, height)); + } + return; +} + +static void vf_setrule(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + SIGNED_QUAD width, height, s_width; + height = signed_quad (start, end); + width = signed_quad (start, end); + s_width = sqxfw(ptsize, width); + if (width > 0 && height > 0) { + dvi_rule (s_width, sqxfw(ptsize, height)); + } + dvi_right (s_width); + return; +} + +static void vf_put1(unsigned char **start, unsigned char *end) +{ + dvi_put (unsigned_byte(start, end)); + return; +} + +static void vf_put2(unsigned char **start, unsigned char *end) +{ + dvi_put (unsigned_pair(start, end)); + return; +} + +#ifndef XETEX +static void vf_put3(unsigned char **start, unsigned char *end) +{ + dvi_put (unsigned_triple(start, end)); + return; +} +#endif + +static void vf_push(void) +{ + dvi_push(); + return; +} + +static void vf_pop(void) +{ + dvi_pop(); + return; +} + +static void vf_right (SIGNED_QUAD x, spt_t ptsize) +{ + dvi_right ((SIGNED_QUAD) (sqxfw(ptsize, x))); + return; +} + + +static void vf_right1(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_right (signed_byte (start, end), ptsize); + return; +} + +static void vf_right2(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_right (signed_pair (start, end), ptsize); + return; +} + +static void vf_right3(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_right (signed_triple (start, end), ptsize); + return; +} + +static void vf_right4(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_right (signed_quad (start, end), ptsize); + return; +} + +static void vf_w0(void) +{ + dvi_w0(); + return; +} + +static void vf_w (SIGNED_QUAD w, spt_t ptsize) +{ + dvi_w ((SIGNED_QUAD) (sqxfw(ptsize, w))); + return; +} + +static void vf_w1(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_w (signed_byte(start, end), ptsize); + return; +} + +static void vf_w2(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_w (signed_pair(start, end), ptsize); + return; +} + +static void vf_w3(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_w (signed_triple(start, end), ptsize); + return; +} + +static void vf_w4(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_w (signed_quad(start, end), ptsize); + return; +} + +static void vf_x0(void) +{ + dvi_x0(); + return; +} + +static void vf_x (SIGNED_QUAD x, spt_t ptsize) +{ + dvi_x ((SIGNED_QUAD) (sqxfw(ptsize, x))); + return; +} + +static void vf_x1(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_x (signed_byte(start, end), ptsize); + return; +} + +static void vf_x2(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_x (signed_pair(start, end), ptsize); + return; +} + +static void vf_x3(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_x (signed_triple(start, end), ptsize); + return; +} + +static void vf_x4(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_x (signed_quad(start, end), ptsize); + return; +} + +static void vf_down (SIGNED_QUAD y, spt_t ptsize) +{ + dvi_down ((SIGNED_QUAD) (sqxfw(ptsize, y))); + return; +} + +static void vf_down1(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_down (signed_byte(start, end), ptsize); + return; +} + +static void vf_down2(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_down (signed_pair(start, end), ptsize); + return; +} + +static void vf_down3(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_down (signed_triple(start, end), ptsize); + return; +} + +static void vf_down4(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_down (signed_quad(start, end), ptsize); + return; +} + +static void vf_y0(void) +{ + dvi_y0(); + return; +} + +static void vf_y (SIGNED_QUAD y, spt_t ptsize) +{ + dvi_y ((SIGNED_QUAD) (sqxfw(ptsize, y))); + return; +} + + +static void vf_y1(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_y (signed_byte(start, end), ptsize); + return; +} + +static void vf_y2(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_y (signed_pair(start, end), ptsize); + return; +} + +static void vf_y3(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_y (signed_triple(start, end), ptsize); + return; +} + +static void vf_y4(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_y (signed_quad(start, end), ptsize); + return; +} + +static void vf_z0(void) +{ + dvi_z0(); + return; +} + +static void vf_z (SIGNED_QUAD z, spt_t ptsize) +{ + dvi_z ((SIGNED_QUAD) (sqxfw(ptsize, z))); + return; +} + +static void vf_z1(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_z (signed_byte(start, end), ptsize); + return; +} + +static void vf_z2(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_z (signed_pair(start, end), ptsize); + return; +} + +static void vf_z3(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_z (signed_triple(start, end), ptsize); + return; +} + +static void vf_z4(unsigned char **start, unsigned char *end, spt_t ptsize) +{ + vf_z (signed_quad(start, end), ptsize); + return; +} + +static void vf_fnt (SIGNED_QUAD font_id, unsigned long vf_font) +{ + int i; + for (i=0; i 0) + default_font = ((vf_fonts[vf_font].dev_fonts)[0]).dev_id; + dvi_vf_init (default_font); + if (ch >= vf_fonts[vf_font].num_chars || + !(start = (vf_fonts[vf_font].ch_pkt)[ch])) { + fprintf (stderr, "\nchar=0x%lx(%ld)\n", ch, ch); + fprintf (stderr, "Tried to set a nonexistent character in a virtual font"); + start = end = NULL; + } else { + end = start + (vf_fonts[vf_font].pkt_len)[ch]; + } + while (start && start < end) { + opcode = *(start++); +#ifdef DEBUG + fprintf (stderr, "VF opcode: %d", opcode); + if (isprint (opcode)) fprintf (stderr, " (\'%c\')\n", opcode); + else fprintf (stderr, "\n"); +#endif + switch (opcode) + { + case SET1: + vf_set1(&start, end); + break; + case SET2: + vf_set2(&start, end); + break; + case SET3: +#ifndef XETEX + vf_set3(&start, end); + break; +#endif + case SET4: + ERROR ("Multibyte (>%d bits) character in VF packet.\nI can't handle this!", + MAX_BITS); + break; + case SET_RULE: + vf_setrule(&start, end, ptsize); + break; + case PUT1: + vf_put1(&start, end); + break; + case PUT2: + vf_put2(&start, end); + break; + case PUT3: +#ifndef XETEX + vf_put3(&start, end); + break; +#endif + case PUT4: + ERROR ("Multibyte (>%d bits) character in VF packet.\nI can't handle this!", + MAX_BITS); + break; + case PUT_RULE: + vf_putrule(&start, end, ptsize); + break; + case NOP: + break; + case PUSH: + vf_push(); + break; + case POP: + vf_pop(); + break; + case RIGHT1: + vf_right1(&start, end, ptsize); + break; + case RIGHT2: + vf_right2(&start, end, ptsize); + break; + case RIGHT3: + vf_right3(&start, end, ptsize); + break; + case RIGHT4: + vf_right4(&start, end, ptsize); + break; + case W0: + vf_w0(); + break; + case W1: + vf_w1(&start, end, ptsize); + break; + case W2: + vf_w2(&start, end, ptsize); + break; + case W3: + vf_w3(&start, end, ptsize); + break; + case W4: + vf_w4(&start, end, ptsize); + break; + case X0: + vf_x0(); + break; + case X1: + vf_x1(&start, end, ptsize); + break; + case X2: + vf_x2(&start, end, ptsize); + break; + case X3: + vf_x3(&start, end, ptsize); + break; + case X4: + vf_x4(&start, end, ptsize); + break; + case DOWN1: + vf_down1(&start, end, ptsize); + break; + case DOWN2: + vf_down2(&start, end, ptsize); + break; + case DOWN3: + vf_down3(&start, end, ptsize); + break; + case DOWN4: + vf_down4(&start, end, ptsize); + break; + case Y0: + vf_y0(); + break; + case Y1: + vf_y1(&start, end, ptsize); + break; + case Y2: + vf_y2(&start, end, ptsize); + break; + case Y3: + vf_y3(&start, end, ptsize); + break; + case Y4: + vf_y4(&start, end, ptsize); + break; + case Z0: + vf_z0(); + break; + case Z1: + vf_z1(&start, end, ptsize); + break; + case Z2: + vf_z2(&start, end, ptsize); + break; + case Z3: + vf_z3(&start, end, ptsize); + break; + case Z4: + vf_z4(&start, end, ptsize); + break; + case FNT1: + vf_fnt1(&start, end, vf_font); + break; + case FNT2: + vf_fnt2(&start, end, vf_font); + break; + case FNT3: + vf_fnt3(&start, end, vf_font); + break; + case FNT4: + vf_fnt4(&start, end, vf_font); + break; + case XXX1: + vf_xxx1(&start, end); + break; + case XXX2: + vf_xxx2(&start, end); + break; + case XXX3: + vf_xxx3(&start, end); + break; + case XXX4: + vf_xxx4(&start, end); + break; + case PTEXDIR: + vf_dir(&start, end); + break; + default: + if (opcode <= SET_CHAR_127) { + vf_set (opcode); + } else if (opcode >= FNT_NUM_0 && opcode <= FNT_NUM_63) { + vf_fnt (opcode - FNT_NUM_0, vf_font); + } else { + fprintf (stderr, "Unexpected opcode: %d\n", opcode); + ERROR ("Unexpected opcode in vf file\n"); + } + } + } + dvi_vf_finish(); + } else { + fprintf (stderr, "vf_set_char: font: %d", vf_font); + ERROR ("Font not loaded\n"); + } + return; +} + + +void vf_close_all_fonts(void) +{ + unsigned long i; + int j; + struct font_def *one_font; + for (i=0; i directory); + RELEASE (one_font -> name); + } + if (vf_fonts[i].dev_fonts != NULL) + RELEASE (vf_fonts[i].dev_fonts); + } + if (vf_fonts != NULL) + RELEASE (vf_fonts); + return; +} diff --git a/Build/source/texk/dvipdfm-x/xbb.h b/Build/source/texk/dvipdfm-x/xbb.h new file mode 100644 index 00000000000..5c8e25c1fd8 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/xbb.h @@ -0,0 +1,31 @@ +/* + + This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. + + Copyright (C) 2008-2012 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + the dvipdfmx project team. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + +#ifndef _XBB_H_ +#define _XBB_H_ + +#define EBB_OUTPUT 0 +#define XBB_OUTPUT 1 + +extern int extractbb(int argc, char *argv[], int mode); + +#endif /* _XBB_H_ */ diff --git a/Build/source/texk/dvipdfm-x/xsrc/cidtype0.c b/Build/source/texk/dvipdfm-x/xsrc/cidtype0.c index 52f5aa907dc..de8f0deac34 100644 --- a/Build/source/texk/dvipdfm-x/xsrc/cidtype0.c +++ b/Build/source/texk/dvipdfm-x/xsrc/cidtype0.c @@ -2069,7 +2069,8 @@ void CIDFont_type0_release(CIDFont *font) { #ifdef XETEX - if (font->ft_to_gid) RELEASE(font->ft_to_gid); + if (font->ft_to_gid) + RELEASE(font->ft_to_gid); #endif return; } diff --git a/Build/source/texk/dvipdfm-x/xsrc/cidtype2.c b/Build/source/texk/dvipdfm-x/xsrc/cidtype2.c index 514f1c1941f..edea6e916ed 100644 --- a/Build/source/texk/dvipdfm-x/xsrc/cidtype2.c +++ b/Build/source/texk/dvipdfm-x/xsrc/cidtype2.c @@ -568,9 +568,10 @@ CIDFont_type2_dofont (CIDFont *font) ERROR("Invalid TTC index in %s.", font->ident); break; case SFNT_TYPE_TRUETYPE: -#ifndef XETEX +#ifdef XETEX /* disable the check here becuase sfnt_open() does not distinguish dfont * from regular trutype */ +#else if (font->options->index > 0) ERROR("Found TrueType font file while expecting TTC file (%s).", font->ident); #endif @@ -976,15 +977,11 @@ CIDFont_type2_open (CIDFont *font, const char *name, #ifdef XETEX /* disable the check here becuase sfnt_open() does not distinguish dfont * from regular trutype */ - offset = 0; #else - assert (opt->index == 0); - if (opt->index > 0) { + if (opt->index > 0) ERROR("Invalid TTC index (not TTC font): %s", name); - } else { - offset = 0; - } #endif + offset = 0; break; case SFNT_TYPE_DFONT: offset = sfont->offset; diff --git a/Build/source/texk/dvipdfm-x/xsrc/dpxfile.c b/Build/source/texk/dvipdfm-x/xsrc/dpxfile.c deleted file mode 100644 index 885bb1635f0..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/dpxfile.c +++ /dev/null @@ -1,1175 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef _MSC_VER -#include -#endif - -#include - -#include "system.h" -#include "error.h" -#include "mem.h" - -#include "dpxutil.h" -#include "mfileio.h" - -#include "dpxfile.h" -#include "dpxcrypt.h" -#define MAX_KEY_LEN 16 - -#include -#include -#ifdef WIN32 -#include -#include -#else -#if HAVE_SYS_WAIT_H -#include -#endif -#ifndef WEXITSTATUS -#define WEXITSTATUS(val) ((unsigned)(val) >> 8) -#endif -#ifndef WIFEXITED -#define WIFEXITED(val) (((val) & 255) == 0) -#endif -#endif - -static int verbose = 0; -int keep_cache = 0; - -void -dpx_file_set_verbose (void) -{ - verbose++; -} - - -/* Kpathsea library does not check file type. */ -static int qcheck_filetype (const char *fqpn, int type); - -/* For testing MIKTEX enabled compilation */ -#if defined(TESTCOMPILE) && !defined(MIKTEX) -# define MIKTEX 1 -# define PATH_SEP_CHR '/' -# define _MAX_PATH 256 - -static int -miktex_get_acrobat_font_dir (char *buf) -{ - strcpy(buf, "/usr/share/ghostscript/Resource/Font/"); - return 1; -} - -static int -miktex_find_file (const char *filename, const char *dirlist, char *buf) -{ - int r = 0; - char *fqpn; - - fqpn = kpse_path_search(dirlist, filename, 0); - if (!fqpn) - return 0; - if (strlen(fqpn) > _MAX_PATH) - r = 0; - else { - strcpy(buf, fqpn); - r = 1; - } - RELEASE(fqpn); - - return r; -} - -static int -miktex_find_app_input_file (const char *progname, const char *filename, char *buf) -{ - int r = 0; - char *fqpn; - - kpse_reset_program_name(progname); - fqpn = kpse_find_file (filename, kpse_program_text_format, false); - kpse_reset_program_name(PACKAGE); - - if (!fqpn) - return 0; - if (strlen(fqpn) > _MAX_PATH) - r = 0; - else { - strcpy(buf, fqpn); - r = 1; - } - RELEASE(fqpn); - - return r; -} - -static int -miktex_find_psheader_file (const char *filename, char *buf) -{ - int r; - char *fqpn; - - fqpn = kpse_find_file(filename, kpse_tex_ps_header_format, 0); - - if (!fqpn) - return 0; - if (strlen(fqpn) > _MAX_PATH) - r = 0; - else { - strcpy(buf, fqpn); - r = 1; - } - RELEASE(fqpn); - - return r; -} - -#endif /* TESTCOMPILE */ - -#ifdef MIKTEX -#ifndef PATH_SEP_CHR -# define PATH_SEP_CHR '\\' -#endif -static char _tmpbuf[_MAX_PATH+1]; -#endif /* MIKTEX */ - -static int exec_spawn (char *cmd) -{ - char **cmdv, **qv; - char *p, *pp; - char buf[1024]; - int i, ret = -1; - - if (!cmd) - return -1; - while (*cmd == ' ' || *cmd == '\t') - cmd++; - if (*cmd == '\0') - return -1; - i = 0; - p = cmd; - while (*p) { - if (*p == ' ' || *p == '\t') - i++; - p++; - } - cmdv = xcalloc (i + 2, sizeof (char *)); - p = cmd; - qv = cmdv; - while (*p) { - pp = buf; - if (*p == '"') { - p++; - while (*p != '"') { - if (*p == '\0') { - goto done; - } - *pp++ = *p++; - } - p++; - } else if (*p == '\'') { - p++; - while (*p != '\'') { - if (*p == '\0') { - goto done; - } - *pp++ = *p++; - } - p++; - } else { - while (*p != ' ' && *p != '\t' && *p) { - if (*p == '\'') { - p++; - while (*p != '\'') { - if (*p == '\0') { - goto done; - } - *pp++ = *p++; - } - p++; - } else { - *pp++ = *p++; - } - } - } - *pp = '\0'; -#ifdef WIN32 - if (strchr (buf, ' ') || strchr (buf, '\t')) - *qv = concat3 ("\"", buf, "\""); - else -#endif - *qv = xstrdup (buf); -/* - fprintf(stderr,"\n%s", *qv); -*/ - while (*p == ' ' || *p == '\t') - p++; - qv++; - } -#ifdef WIN32 - ret = spawnvp (_P_WAIT, *cmdv, (const char* const*) cmdv); -#else - i = fork (); - if (i < 0) - ret = -1; - else if (i == 0) { - if (execvp (*cmdv, cmdv)) - _exit (-1); - } else { - if (wait (&ret) == i) { - ret = (WIFEXITED (ret) ? WEXITSTATUS (ret) : -1); - } else { - ret = -1; - } - } -#endif -done: - qv = cmdv; - while (*qv) { - free (*qv); - qv++; - } - free (cmdv); - return ret; -} - -/* ensuresuffix() returns a copy of basename if sfx is "". */ -static char * -ensuresuffix (const char *basename, const char *sfx) -{ - char *q, *p; - - p = NEW(strlen(basename) + strlen(sfx) + 1, char); - strcpy(p, basename); - q = strrchr(p, '.'); - if (!q && sfx[0]) - strcat(p, sfx); - - return p; -} - -#ifdef MIKTEX -static char * -dpx_find__app__xyz (const char *filename, - const char *suffix, int is_text) -{ - char *fqpn = NULL; - int r; - char *q; - - q = ensuresuffix(filename, suffix); - r = miktex_find_app_input_file(PACKAGE, q, _tmpbuf); - if (!r && strcmp(q, filename)) - r = miktex_find_app_input_file(PACKAGE, filename, _tmpbuf); - if (r) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } - RELEASE(q); - - return fqpn; -} - -static char * -dpx_foolsearch (const char *foolname, - const char *filename, - int is_text) -{ - char *fqpn = NULL; - int r; - - r = miktex_find_app_input_file(foolname, filename, _tmpbuf); - if (r) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } - - return fqpn; -} -#else /* !MIKTEX */ -# define TDS11DOC "http://www.tug.org/ftp/tex/tds-1.1/tds.html#Fonts" -static void -insistupdate (const char *filename, - const char *fqpn, - const char *foolname, - kpse_file_format_type foolformat, - kpse_file_format_type realformat) -{ - kpse_format_info_type *fif; - kpse_format_info_type *fir; - if (verbose < 1) - return; - fif = &kpse_format_info[foolformat]; - fir = &kpse_format_info[realformat]; - WARN("File name=\"%s\" format=\"%s\" might be found in different location than I expected:", - filename, fir->type); - WARN(">> %s", fqpn); - WARN(">> Please adjust your TEXMF as conformant with:"); - WARN(">> " TDS11DOC); - WARN(">> I searched it with fooling kpathsea as progname=\"%s\" format=\"%s\".", - foolname, fif->type); - WARN(">> Default search path for this format file is:"); - WARN(">> %s", fir->default_path); - WARN(">> Please read \"README\" file."); -} - -static char * -dpx_find__app__xyz (const char *filename, - const char *suffix, int is_text) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, suffix); - fqpn = kpse_find_file(q, - (is_text ? - kpse_program_text_format : kpse_program_binary_format), 0); - if (!fqpn && strcmp(q, filename)) - fqpn = kpse_find_file(filename, - (is_text ? - kpse_program_text_format : kpse_program_binary_format), 0); - RELEASE(q); - - return fqpn; -} - -static char * -dpx_foolsearch (const char *foolname, - const char *filename, - int is_text) -{ - char *fqpn = NULL; - - kpse_reset_program_name(foolname); - fqpn = kpse_find_file (filename, - (is_text ? - kpse_program_text_format : - kpse_program_binary_format), - false); - kpse_reset_program_name(PACKAGE); - - return fqpn; -} -#endif /* MIKTEX */ - -static char *dpx_find_fontmap_file (const char *filename); -static char *dpx_find_agl_file (const char *filename); -static char *dpx_find_sfd_file (const char *filename); -static char *dpx_find_cmap_file (const char *filename); -static char *dpx_find_enc_file (const char *filename); -static char *dpx_find_iccp_file (const char *filename); - -FILE * -dpx_open_file (const char *filename, int type) -{ - FILE *fp = NULL; - char *fqpn = NULL; - - switch (type) { - case DPX_RES_TYPE_FONTMAP: - fqpn = dpx_find_fontmap_file(filename); - break; - case DPX_RES_TYPE_T1FONT: - fqpn = dpx_find_type1_file(filename); - break; - case DPX_RES_TYPE_TTFONT: - fqpn = dpx_find_truetype_file(filename); - break; - case DPX_RES_TYPE_OTFONT: - fqpn = dpx_find_opentype_file(filename); - break; - case DPX_RES_TYPE_PKFONT: - break; - case DPX_RES_TYPE_CMAP: - fqpn = dpx_find_cmap_file(filename); - break; - case DPX_RES_TYPE_ENC: - fqpn = dpx_find_enc_file(filename); - break; - case DPX_RES_TYPE_SFD: - fqpn = dpx_find_sfd_file(filename); - break; - case DPX_RES_TYPE_AGL: - fqpn = dpx_find_agl_file(filename); - break; - case DPX_RES_TYPE_ICCPROFILE: - fqpn = dpx_find_iccp_file(filename); - break; - case DPX_RES_TYPE_DFONT: - fqpn = dpx_find_dfont_file(filename); - break; - case DPX_RES_TYPE_BINARY: - fqpn = dpx_find__app__xyz(filename, "", 0); - break; - case DPX_RES_TYPE_TEXT: - fqpn = dpx_find__app__xyz(filename, "", 1); - break; - default: - ERROR("Unknown resource type: %d", type); - break; - } - if (fqpn) { - fp = MFOPEN(fqpn, FOPEN_RBIN_MODE); - RELEASE(fqpn); - } - - return fp; -} - - -static char * -dpx_find_iccp_file (const char *filename) -{ - char *fqpn = NULL; - - fqpn = dpx_find__app__xyz(filename, "", 0); - if (fqpn || strrchr(filename, '.')) - return fqpn; - - fqpn = dpx_find__app__xyz(filename, ".icc", 0); - if (fqpn) - return fqpn; - - fqpn = dpx_find__app__xyz(filename, ".icm", 0); - - return fqpn; -} - - -static char * -dpx_find_fontmap_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, ".map"); -#ifdef MIKTEX - fqpn = dpx_find__app__xyz(q, ".map", 1); -#else /* !MIKTEX */ - fqpn = kpse_find_file(q, kpse_fontmap_format, 0); - if (!fqpn) { - fqpn = dpx_find__app__xyz(q, ".map", 1); - if (fqpn) - insistupdate(q, fqpn, PACKAGE, - kpse_program_text_format, kpse_fontmap_format); - } -#endif /* MIKETEX */ - RELEASE(q); - - return fqpn; -} - - -static char * -dpx_find_agl_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, ".txt"); -#ifdef MIKTEX - fqpn = dpx_find__app__xyz(q, ".txt", 1); -#else /* !MIKTEX */ - fqpn = kpse_find_file(q, kpse_fontmap_format, 0); - if (!fqpn) { - fqpn = dpx_find__app__xyz(q, ".txt", 1); - if (fqpn) - insistupdate(q, fqpn, PACKAGE, - kpse_program_text_format, kpse_fontmap_format); - } -#endif /* MIKETEX */ - RELEASE(q); - - return fqpn; -} - - -/* cmap.sty put files into tex/latex/cmap */ -static char * -dpx_find_cmap_file (const char *filename) -{ - char *fqpn = NULL; - static const char *fools[] = { - "cmap", "tex", NULL - }; - int i; - -#if defined(MIKTEX) - /* Find in Acrobat's Resource/CMap dir */ - { - char _acrodir[_MAX_PATH+1]; - char *q; - int r; - - memset(_acrodir, 0, _MAX_PATH+1); - r = miktex_get_acrobat_font_dir(_acrodir); - if (r && - strlen(_acrodir) > strlen("Font")) { - /* ....\Font\ */ - q = strrchr(_acrodir, PATH_SEP_CHR); - if (q && q[1] == '\0') - q[0] = '\0'; - q = strrchr(_acrodir, PATH_SEP_CHR); - if (q && !strcmp(q + 1, "Font")) { - sprintf(q, "%cCMap%c", PATH_SEP_CHR, PATH_SEP_CHR); - r = miktex_find_file(filename, _acrodir, _tmpbuf); - if (r) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } - } - } - memset(_tmpbuf, 0, _MAX_PATH+1); - } -#else - fqpn = kpse_find_file(filename, kpse_cmap_format, 0); -#endif - - /* Files found above are assumed to be CMap, - * if it's not really CMap it will cause an error. - */ - for (i = 0; !fqpn && fools[i]; i++) { - fqpn = dpx_foolsearch(fools[i], filename, 1); - if (fqpn) { -#ifndef MIKTEX - insistupdate(filename, fqpn, fools[i], - kpse_program_text_format, kpse_cmap_format); -#endif - if (!qcheck_filetype(fqpn, DPX_RES_TYPE_CMAP)) { - WARN("Found file \"%s\" for PostScript CMap but it doesn't look like a CMap...", fqpn); - RELEASE(fqpn); - fqpn = NULL; - } - } - } - - return fqpn; -} - - -/* Search order: - * SFDFONTS (TDS 1.1) - * ttf2pk (text file) - * ttf2tfm (text file) - * dvipdfm (text file) - */ -static char * -dpx_find_sfd_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - static const char *fools[] = { - "ttf2pk", "ttf2tfm", NULL - }; - int i; - - q = ensuresuffix(filename, ".sfd"); -#ifndef MIKTEX - fqpn = kpse_find_file(q, kpse_sfd_format, 0); -#endif /* !MIKTEX */ - - for (i = 0; !fqpn && fools[i]; i++) { - fqpn = dpx_foolsearch(fools[i], q, 1); -#ifndef MIKTEX - if (fqpn) - insistupdate(filename, fqpn, fools[i], - kpse_program_text_format, kpse_sfd_format); -#endif - } - RELEASE(q); - - return fqpn; -} - - -static char * -dpx_find_enc_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - static const char *fools[] = { - "dvips", NULL - }; - int i; - - q = ensuresuffix(filename, ".enc"); -#ifdef MIKTEX - if (miktex_find_psheader_file(q, _tmpbuf)) { - fqpn = NEW(strlen(_tmpbuf) + 1, char); - strcpy(fqpn, _tmpbuf); - } -#else - fqpn = kpse_find_file(q, kpse_enc_format, 0); -#endif /* MIKTEX */ - - for (i = 0; !fqpn && fools[i]; i++) { - fqpn = dpx_foolsearch(fools[i], q, 1); -#ifndef MIKTEX - if (fqpn) - insistupdate(filename, fqpn, fools[i], - kpse_program_text_format, kpse_enc_format); -#endif - } - RELEASE(q); - - return fqpn; -} - -static int -is_absolute_path(const char *filename) -{ -#ifdef WIN32 - if (isalpha(filename[0]) && filename[1] == ':') - return 1; - if (filename[0] == '\\' && filename[1] == '\\') - return 1; - if (filename[0] == '/' && filename[1] == '/') - return 1; -#else - if (filename[0] == '/') - return 1; -#endif - return 0; -} - -char * -dpx_find_type1_file (const char *filename) -{ - char *fqpn = NULL; - - if (is_absolute_path(filename)) - fqpn = xstrdup(filename); - else - fqpn = kpse_find_file(filename, kpse_type1_format, 0); - if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_T1FONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - - return fqpn; -} - - -char * -dpx_find_truetype_file (const char *filename) -{ - char *fqpn = NULL; - - if (is_absolute_path(filename)) - fqpn = xstrdup(filename); - else - fqpn = kpse_find_file(filename, kpse_truetype_format, 0); - if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_TTFONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - - return fqpn; -} - - -char * -dpx_find_opentype_file (const char *filename) -{ - char *fqpn = NULL; - char *q; - - q = ensuresuffix(filename, ".otf"); -#ifndef MIKTEX - if (is_absolute_path(q)) - fqpn = xstrdup(q); - else - fqpn = kpse_find_file(q, kpse_opentype_format, 0); - if (!fqpn) { -#endif - fqpn = dpx_foolsearch(PACKAGE, q, 0); -#ifndef MIKTEX - if (fqpn) - insistupdate(filename, fqpn, PACKAGE, - kpse_program_binary_format, kpse_opentype_format); - } -#endif - RELEASE(q); - - /* *We* use "opentype" for ".otf" (CFF). */ - if (fqpn && !qcheck_filetype(fqpn, DPX_RES_TYPE_OTFONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - - return fqpn; -} - - - -char * -dpx_find_dfont_file (const char *filename) -{ - char *fqpn = NULL; - - fqpn = kpse_find_file(filename, kpse_truetype_format, 0); - if (fqpn) { - int len = strlen(fqpn); - if (len > 6 && strncmp(fqpn+len-6, ".dfont", 6)) { - fqpn = RENEW(fqpn, len+6, char); - strcat(fqpn, "/rsrc"); - } - } - if (!qcheck_filetype(fqpn, DPX_RES_TYPE_DFONT)) { - RELEASE(fqpn); - fqpn = NULL; - } - return fqpn; -} - -static const char * -dpx_get_tmpdir (void) -{ -# ifdef WIN32 -# define __TMPDIR "." -# else /* WIN32 */ -# define __TMPDIR "/tmp" -#endif /* WIN32 */ - const char *_tmpd; - -# ifdef HAVE_GETENV - _tmpd = getenv("TMPDIR"); -# ifdef WIN32 - if (!_tmpd) - _tmpd = getenv("TMP"); - if (!_tmpd) - _tmpd = getenv("TEMP"); -# endif /* WIN32 */ - if (!_tmpd) - _tmpd = __TMPDIR; -# else /* HAVE_GETENV */ - _tmpd = __TMPDIR; -# endif /* HAVE_GETENV */ - return _tmpd; -} - -#ifdef HAVE_MKSTEMP -# include -#endif - -#ifdef XETEX -char * -dpx_create_temp_file (void) -{ - char *tmp = NULL; - -#if defined(MIKTEX) - { - tmp = NEW(_MAX_PATH + 1, char); - miktex_create_temp_file_name(tmp); /* FIXME_FIXME */ - } -#elif defined(HAVE_MKSTEMP) -# define TEMPLATE "/dvipdfmx.XXXXXXXX" - { - const char *_tmpd; - int _fd = -1; - _tmpd = dpx_get_tmpdir(); - tmp = NEW(strlen(_tmpd) + strlen(TEMPLATE) + 1, char); - strcpy(tmp, _tmpd); - strcat(tmp, TEMPLATE); - _fd = mkstemp(tmp); - if (_fd != -1) -#ifdef WIN32 - _close(_fd); -#else - close(_fd); -#endif /* WIN32 */ - else { - RELEASE(tmp); - tmp = NULL; - } - } -#else /* use _tempnam or tmpnam */ - { -# ifdef WIN32 - const char *_tmpd; - char *p; - _tmpd = dpx_get_tmpdir(); - tmp = _tempnam (_tmpd, "dvipdfmx."); - for (p = tmp; *p; p++) { - if (IS_KANJI (p)) - p++; - else if (*p == '\\') - *p = '/'; - } -# else /* WIN32 */ - char *_tmpa = NEW(L_tmpnam + 1, char); - tmp = tmpnam(_tmpa); - if (!tmp) - RELEASE(_tmpa); -# endif /* WIN32 */ - } -#endif /* MIKTEX */ - - return tmp; -} -#endif /* XETEX */ - -char * -dpx_create_fix_temp_file (const char *filename) -{ -#define PREFIX "xdvipdfmx." - static const char *dir = NULL; - static char *cwd = NULL; - char *ret, *s; - int i; - MD5_CONTEXT state; - unsigned char digest[MAX_KEY_LEN]; -#ifdef WIN32 - char *p; -#endif - - if (!dir) { - dir = dpx_get_tmpdir(); - cwd = xgetcwd(); - } - - MD5_init(&state); - MD5_write(&state, (unsigned char *)cwd, strlen(cwd)); - MD5_write(&state, (unsigned const char *)filename, strlen(filename)); - MD5_final(digest, &state); - - ret = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); - sprintf(ret, "%s/%s", dir, PREFIX); - s = ret + strlen(ret); - for (i=0; id_name) != plen + MAX_KEY_LEN * 2) return 0; -#ifdef WIN32 - return strncasecmp(ent->d_name, PREFIX, plen) == 0; -#else - return strncmp(ent->d_name, PREFIX, plen) == 0; -#endif -} - -void -dpx_delete_old_cache (int life) -{ - const char *dir; - char *pathname; - DIR *dp; - struct dirent *de; - time_t limit; - - if (life == -2) { - keep_cache = -1; - return; - } - - dir = dpx_get_tmpdir(); - pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); - limit = time(NULL) - life * 60 * 60; - - if (life >= 0) keep_cache = 1; - if ((dp = opendir(dir)) != NULL) { - while((de = readdir(dp)) != NULL) { - if (dpx_clear_cache_filter(de)) { - struct stat sb; - sprintf(pathname, "%s/%s", dir, de->d_name); - stat(pathname, &sb); - if (sb.st_mtime < limit) { - remove(pathname); - /* printf("remove: %s\n", pathname); */ - } - } - } - closedir(dp); - } - RELEASE(pathname); -} - -void -dpx_delete_temp_file (char *tmp, int force) -{ - if (!tmp) - return; - if (force || keep_cache != 1) remove (tmp); - RELEASE(tmp); - - return; -} - -/* dpx_file_apply_filter() is used for converting unsupported graphics - * format to one of the formats that dvipdfmx can natively handle. - * 'input' is the filename of the original file and 'output' is actually - * temporal files 'generated' by the above routine. - * This should be system dependent. (MiKTeX may want something different) - * Please modify as appropriate (see also pdfximage.c and dvipdfmx.c). - */ -int -dpx_file_apply_filter (const char *cmdtmpl, - const char *input, const char *output, - unsigned char version) -{ - char *cmd = NULL; - const char *p, *q; - size_t n, size; - int error = 0; - - if (!cmdtmpl) - return -1; - else if (!input || !output) - return -1; - - size = strlen(cmdtmpl) + strlen(input) + strlen(output) + 3; - cmd = NEW(size, char); - memset(cmd, 0, size); - for (n = 0, p = cmdtmpl; *p != 0; p++) { -#define need(s,l,m,n) \ -if ((l) + (n) >= (m)) { \ - (m) += (n) + 128; \ - (s) = RENEW((s), (m), char); \ -} - if (p[0] == '%') { - p++; - switch (p[0]) { - case 'o': /* Output file name */ - need(cmd, n, size, strlen(output)); - strcpy(cmd + n, output); n += strlen(output); - break; - case 'i': /* Input filename */ - need(cmd, n, size, strlen(input)); - strcpy(cmd + n, input); n += strlen(input); - break; - case 'b': - need(cmd, n, size, strlen(input)); - q = strrchr(input, '.'); /* wrong */ - if (q) { - memcpy(cmd + n, input, (int) (q - input)); - n += (int) (q - input); - } else { - strcpy(cmd + n, input); n += strlen(input); - } - case 'v': /* Version number, e.g. 1.4 */ { - char buf[6]; - sprintf(buf, "1.%hu", (unsigned short) version); - need(cmd, n, size, strlen(buf)); - strcpy(cmd + n, buf); n += strlen(buf); - break; - } - case 0: - break; - case '%': - need(cmd, n, size, 1); - cmd[n] = '%'; n++; - break; - } - } else { - need(cmd, n, size, 1); - cmd[n] = p[0]; n++; - } - } - need(cmd, n, size, 1); - cmd[n] = '\0'; - if (strlen(cmd) == 0) { - RELEASE(cmd); - return -1; - } - - error = exec_spawn(cmd); - if (error) - WARN("Filtering file via command -->%s<-- failed.", cmd); - RELEASE(cmd); - - return error; -} - -static char _sbuf[128]; -/* - * SFNT type sigs: - * `true' (0x74727565): TrueType (Mac) - * `typ1' (0x74797031) (Mac): PostScript font housed in a sfnt wrapper - * 0x00010000: TrueType (Win)/OpenType - * `OTTO': PostScript CFF font with OpenType wrapper - * `ttcf': TrueType Collection - */ -static int -istruetype (FILE *fp) -{ - int n; - - rewind(fp); - n = fread(_sbuf, 1, 4, fp); - rewind(fp); - - if (n != 4) - return 0; - else if (!memcmp(_sbuf, "true", 4) || - !memcmp(_sbuf, "\0\1\0\0", 4)) /* This doesn't help... */ - return 1; - else if (!memcmp(_sbuf, "ttcf", 4)) - return 1; - - return 0; -} - -/* "OpenType" is only for ".otf" here */ -static int -isopentype (FILE *fp) -{ - int n; - - rewind(fp); - n = fread(_sbuf, 1, 4, fp); - rewind(fp); - - if (n != 4) - return 0; - else if (!memcmp(_sbuf, "OTTO", 4)) - return 1; - else - return 0; -} - -static int -ist1binary (FILE *fp) -{ - char *p; - int n; - - rewind(fp); - n = fread(_sbuf, 1, 21, fp); - rewind(fp); - - p = _sbuf; - if (n != 21) - return 0; - else if (p[0] != (char) 0x80 || p[1] < 0 || p[1] > 3) - return 0; - else if (!memcmp(p + 6, "%!PS-AdobeFont", 14) || - !memcmp(p + 6, "%!FontType1", 11)) - return 1; - else if (!memcmp(p + 6, "%!PS", 4)) { -#if 0 - p[20] = '\0'; p += 6; - WARN("Ambiguous PostScript resource type: %s", (char *) p); -#endif - return 1; - } - /* Otherwise ambiguious */ - return 0; -} - -/* %!PS-Adobe-x.y Resource-CMap */ -static int -ispscmap (FILE *fp) -{ - char *p; - p = mfgets(_sbuf, 128, fp); p[127] = '\0'; - if (!p || strlen(p) < 4 || memcmp(p, "%!PS", 4)) - return 0; - for (p += 4; *p && !isspace(*p); p++); - for ( ; *p && (*p == ' ' || *p == '\t'); p++); - if (*p == '\0' || strlen(p) < strlen("Resource-CMap")) - return 0; - else if (!memcmp(p, "Resource-CMap", strlen("Resource-CMap"))) - return 1; - /* Otherwise ambiguious */ - return 0; -} - -static int -isdfont (FILE *fp) -{ - int i, n; - unsigned long pos; - - rewind(fp); - - get_unsigned_quad(fp); - seek_absolute(fp, (pos = get_unsigned_quad(fp)) + 0x18); - seek_absolute(fp, pos + get_unsigned_pair(fp)); - n = get_unsigned_pair(fp); - for (i = 0; i <= n; i++) { - if (get_unsigned_quad(fp) == 0x73666e74UL) /* "sfnt" */ - return 1; - get_unsigned_quad(fp); - } - return 0; -} - -/* This actually opens files. */ -static int -qcheck_filetype (const char *fqpn, int type) -{ - int r = 1; - FILE *fp; - - if (!fqpn) - return 0; - - fp = MFOPEN(fqpn, FOPEN_RBIN_MODE); - if (!fp) { - WARN("File \"%s\" found but I could not open that...", fqpn); - return 0; - } - switch (type) { - case DPX_RES_TYPE_T1FONT: - r = ist1binary(fp); - break; - case DPX_RES_TYPE_TTFONT: - r = istruetype(fp); - break; - case DPX_RES_TYPE_OTFONT: - r = isopentype(fp); - break; - case DPX_RES_TYPE_CMAP: - r = ispscmap(fp); - break; - case DPX_RES_TYPE_DFONT: - r = isdfont(fp); - break; - } - MFCLOSE(fp); - - return r; -} - diff --git a/Build/source/texk/dvipdfm-x/xsrc/dpxfile.h b/Build/source/texk/dvipdfm-x/xsrc/dpxfile.h deleted file mode 100644 index e4ae4c0a679..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/dpxfile.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _DPXFILE_H_ -#define _DPXFILE_H_ - -#define DPX_CONFIG_FILE "dvipdfmx.cfg" - -#define DPX_RES_TYPE_FONTMAP 0x00 - -#define DPX_RES_TYPE_T1FONT 0x10 -#define DPX_RES_TYPE_TTFONT 0x11 -#define DPX_RES_TYPE_OTFONT 0x12 -#define DPX_RES_TYPE_PKFONT 0x13 -#define DPX_RES_TYPE_DFONT 0x14 - -#define DPX_RES_TYPE_ENC 0x20 -#define DPX_RES_TYPE_CMAP 0x21 -#define DPX_RES_TYPE_SFD 0x22 -#define DPX_RES_TYPE_AGL 0x23 - -#define DPX_RES_TYPE_ICCPROFILE 0x30 - -#define DPX_RES_TYPE_BINARY 0x40 -#define DPX_RES_TYPE_TEXT 0x41 - -#include "mfileio.h" -extern FILE *dpx_open_file (const char *filename, int type); - -extern char * dpx_find_type1_file (const char *filename); -extern char * dpx_find_truetype_file (const char *filename); -extern char * dpx_find_opentype_file (const char *filename); -extern char * dpx_find_dfont_file (const char *filename); - -#define DPXFOPEN(n,t) dpx_open_file((const char *)(n),(t)) -#define DPXFCLOSE(f) MFCLOSE((f)) - -extern void dpx_file_set_verbose (void); - -extern int dpx_file_apply_filter (const char *cmdtmpl, - const char *input, const char *output, - unsigned char version); -extern char *dpx_create_temp_file (void); -extern char *dpx_create_fix_temp_file (const char *filename); -extern void dpx_delete_old_cache (int life); -extern void dpx_delete_temp_file (char *tmp, int force); /* tmp freed here */ - -extern int keep_cache; -#endif /* _DPXFILE_H_ */ diff --git a/Build/source/texk/dvipdfm-x/xsrc/dvipdfmx.c b/Build/source/texk/dvipdfm-x/xsrc/dvipdfmx.c index d0dea49a358..d2d775d7f74 100644 --- a/Build/source/texk/dvipdfm-x/xsrc/dvipdfmx.c +++ b/Build/source/texk/dvipdfm-x/xsrc/dvipdfmx.c @@ -6,7 +6,7 @@ Copyright (c) 2006 SIL. (xdvipdfmx extensions for XeTeX support) - Copyright (C) 2008-2013 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + Copyright (C) 2002-2013 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the DVIPDFMx project team. Copyright (C) 1998, 1999 by Mark A. Wicks diff --git a/Build/source/texk/dvipdfm-x/xsrc/fontmap.h b/Build/source/texk/dvipdfm-x/xsrc/fontmap.h deleted file mode 100644 index fee6f238fa5..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/fontmap.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _FONTMAP_H_ -#define _FONTMAP_H_ - -#define FONTMAP_RMODE_REPLACE 0 -#define FONTMAP_RMODE_APPEND '+' -#define FONTMAP_RMODE_REMOVE '-' - -#define FONTMAP_OPT_NOEMBED (1 << 1) -#define FONTMAP_OPT_VERT (1 << 2) - -#define FONTMAP_STYLE_NONE 0 -#define FONTMAP_STYLE_BOLD 1 -#define FONTMAP_STYLE_ITALIC 2 -#define FONTMAP_STYLE_BOLDITALIC 3 - -#ifdef XETEX -#include "ft2build.h" -#include FT_FREETYPE_H -#endif - -/* Options */ -typedef struct fontmap_opt { - /* Synthetic font */ - double slant, extend, bold; - /* comaptibility and other flags */ - long mapc, flags; - - char *otl_tags; /* currently unused */ - char *tounicode; /* not implemented yet */ - - double design_size; /* unused */ - - char *charcoll; /* Adobe-Japan1-4, etc. */ - int index; /* TTC index */ - int style; /* ,Bold, etc. */ - int stemv; /* StemV value especially for CJK fonts */ -#ifdef XETEX - FT_Face ft_face; -#endif -} fontmap_opt; - -typedef struct fontmap_rec { - char *map_name; - - char *font_name; - char *enc_name; - - /* Subfont mapping: translate 8-bit charcode to 16-bit charcode - * via SFD. - */ - struct { - char *sfd_name; - char *subfont_id; - } charmap; - - fontmap_opt opt; -} fontmap_rec; - -extern void pdf_fontmap_set_verbose (void); - -extern void pdf_init_fontmaps (void); -#if 0 -extern void pdf_clear_fontmaps (void); -#endif -extern void pdf_close_fontmaps (void); - -extern void pdf_init_fontmap_record (fontmap_rec *mrec); -extern void pdf_clear_fontmap_record (fontmap_rec *mrec); - -extern int pdf_load_fontmap_file (const char *filename, int mode); -extern int pdf_read_fontmap_line (fontmap_rec *mrec, const char *mline, long mline_strlen, int format); - -extern int pdf_append_fontmap_record (const char *kp, const fontmap_rec *mrec); -extern int pdf_remove_fontmap_record (const char *kp); -extern int pdf_insert_fontmap_record (const char *kp, const fontmap_rec *mrec); -extern fontmap_rec *pdf_lookup_fontmap_record (const char *kp); - -extern int is_pdfm_mapline (const char *mline); - -#ifdef XETEX -extern int pdf_load_native_font (const char *ps_name, - int layout_dir, int extend, int slant, int embolden); -#endif - -#endif /* _FONTMAP_H_ */ diff --git a/Build/source/texk/dvipdfm-x/xsrc/jpegimage.h b/Build/source/texk/dvipdfm-x/xsrc/jpegimage.h deleted file mode 100644 index 5a3c9d86a3d..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/jpegimage.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _JPEGIMAGE_H_ -#define _JPEGIMAGE_H_ - -#include "mfileio.h" -#include "pdfximage.h" - -extern int check_for_jpeg (FILE *fp); -extern int jpeg_include_image (pdf_ximage *ximage, FILE *fp); - -#endif /* _JPEGIMAGE_H_ */ - - diff --git a/Build/source/texk/dvipdfm-x/xsrc/pngimage.h b/Build/source/texk/dvipdfm-x/xsrc/pngimage.h deleted file mode 100644 index 41fd0919f21..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/pngimage.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - - -#ifndef _PNGIMAGE_H_ -#define _PNGIMAGE_H_ - -#ifdef HAVE_LIBPNG - -#include "mfileio.h" -#include "pdfximage.h" - -extern int png_include_image (pdf_ximage *ximage, FILE *file); -extern int check_for_png (FILE *file); - -#endif - -#endif /* _PNGIMAGE_H_ */ diff --git a/Build/source/texk/dvipdfm-x/xsrc/tt_cmap.c b/Build/source/texk/dvipdfm-x/xsrc/tt_cmap.c index 99ec041cc90..a2d800890eb 100644 --- a/Build/source/texk/dvipdfm-x/xsrc/tt_cmap.c +++ b/Build/source/texk/dvipdfm-x/xsrc/tt_cmap.c @@ -1078,7 +1078,9 @@ static cmap_plat_enc_rec cmap_plat_encs[] = { pdf_obj * otf_create_ToUnicode_stream (const char *font_name, int ttc_index, /* 0 for non-TTC */ +#ifdef XETEX FT_Face face, +#endif const char *used_glyphs) { pdf_obj *cmap_ref = NULL; diff --git a/Build/source/texk/dvipdfm-x/xsrc/tt_cmap.h b/Build/source/texk/dvipdfm-x/xsrc/tt_cmap.h deleted file mode 100644 index 30e28950fd4..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/tt_cmap.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _TT_CMAP_H_ -#define _TT_CMAP_H_ - -#include "sfnt.h" - -extern void otf_cmap_set_verbose (void); - -/* TrueType cmap table */ -typedef struct -{ - USHORT format; - USHORT platform; - USHORT encoding; - ULONG language; /* or version, only for Mac */ - void *map; -} tt_cmap; - -/* Paltform ID */ -#define TT_MAC 1u -#define TT_WIN 3u - -/* Platform-specific encoding ID */ - -/* Windows */ -#define TT_WIN_SYMBOL 0u -#define TT_WIN_UNICODE 1u -#define TT_WIN_SJIS 2u -#define TT_WIN_RPC 3u -#define TT_WIN_BIG5 4u -#define TT_WIN_WANSUNG 5u -#define TT_WIN_JOHAB 6u -#define TT_WIN_UCS4 10u - -/* Mac */ -#define TT_MAC_ROMAN 0u -#define TT_MAC_JAPANESE 1u -#define TT_MAC_TRADITIONAL_CHINESE 2u -#define TT_MAC_KOREAN 3u -#define TT_MAC_SIMPLIFIED_CHINESE 25u - -extern tt_cmap *tt_cmap_read (sfnt *sfont, USHORT platform, USHORT encoding); - -extern USHORT tt_cmap_lookup (tt_cmap *cmap, long cc); -extern void tt_cmap_release (tt_cmap *cmap); - -#include "pdfobj.h" - -/* Indirect reference */ -extern pdf_obj *otf_create_ToUnicode_stream (const char *map_name, - int ttc_index, - FT_Face face, - const char *used_glyphs); -/* CMap ID */ -extern int otf_load_Unicode_CMap (const char *map_name, - int ttc_index, - const char *otl_opts, int wmode); - -#endif /* _TT_CMAP_H_ */ diff --git a/Build/source/texk/dvipdfm-x/xsrc/tt_table.c b/Build/source/texk/dvipdfm-x/xsrc/tt_table.c index 009ca5634cb..7447d568c18 100644 --- a/Build/source/texk/dvipdfm-x/xsrc/tt_table.c +++ b/Build/source/texk/dvipdfm-x/xsrc/tt_table.c @@ -79,9 +79,7 @@ char *tt_pack_head_table (struct tt_head_table *table) struct tt_head_table *tt_read_head_table (sfnt *sfont) { int i; - struct tt_head_table *table = NULL; - - table = NEW(1, struct tt_head_table); + struct tt_head_table *table = NEW(1, struct tt_head_table); sfnt_locate_table(sfont, "head"); @@ -136,11 +134,10 @@ char *tt_pack_maxp_table (struct tt_maxp_table *table) struct tt_maxp_table *tt_read_maxp_table (sfnt *sfont) { - struct tt_maxp_table *table = NULL; - - table = NEW(1, struct tt_maxp_table); + struct tt_maxp_table *table = NEW(1, struct tt_maxp_table); sfnt_locate_table(sfont, "maxp"); + table->version = sfnt_get_ulong(sfont); table->numGlyphs = sfnt_get_ushort(sfont); table->maxPoints = sfnt_get_ushort(sfont); @@ -191,11 +188,10 @@ tt_read_hhea_table (sfnt *sfont) { int i; ULONG len; - struct tt_hhea_table *table = NULL; + struct tt_hhea_table *table = NEW(1, struct tt_hhea_table); sfnt_locate_table(sfont, "hhea"); - table = NEW(1, struct tt_hhea_table); table->version = sfnt_get_ulong(sfont); table->ascent = sfnt_get_short (sfont); table->descent = sfnt_get_short(sfont); @@ -255,11 +251,10 @@ struct tt_vhea_table *tt_read_vhea_table (sfnt *sfont) { int i; ULONG len; - struct tt_vhea_table *table = NULL; - - table = NEW(1, struct tt_vhea_table); + struct tt_vhea_table *table = NEW(1, struct tt_vhea_table); sfnt_locate_table(sfont, "vhea"); + table->version = sfnt_get_ulong(sfont); table->vertTypoAscender = sfnt_get_short (sfont); table->vertTypoDescender = sfnt_get_short(sfont); diff --git a/Build/source/texk/dvipdfm-x/xsrc/type0.h b/Build/source/texk/dvipdfm-x/xsrc/type0.h deleted file mode 100644 index 68979decbc6..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/type0.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _TYPE0_H_ -#define _TYPE0_H_ - -#include "pdfobj.h" - -#define add_to_used_chars2(b,c) {(b)[(c)/8] |= (1 << (7-((c)%8)));} -#define is_used_char2(b,c) (((b)[(c)/8]) & (1 << (7-((c)%8)))) - -typedef struct Type0Font Type0Font; - -extern void Type0Font_set_verbose (void); - -extern int Type0Font_get_wmode (Type0Font *font); -#if 0 -extern char *Type0Font_get_encoding (Type0Font *font); -#endif /* 0 */ -extern char *Type0Font_get_usedchars (Type0Font *font); - -extern pdf_obj *Type0Font_get_resource (Type0Font *font); - -extern void Type0Font_set_ToUnicode (Type0Font *font, pdf_obj *cmap_ref); - -#include "fontmap.h" -extern int pdf_font_findfont0 (const char *font_name, - int cmap_id, fontmap_opt *fmap_opt); - -extern unsigned short *Type0Font_get_ft_to_gid(int id); - -/******************************** CACHE ********************************/ - -extern void Type0Font_cache_init (void); -extern Type0Font *Type0Font_cache_get (int id); -extern int Type0Font_cache_find (const char *map_name, int cmap_id, fontmap_opt *fmap_opt); -extern void Type0Font_cache_close (void); - -#endif /* _TYPE0_H_ */ diff --git a/Build/source/texk/dvipdfm-x/xsrc/vf.c b/Build/source/texk/dvipdfm-x/xsrc/vf.c deleted file mode 100644 index 018f87fa2a7..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/vf.c +++ /dev/null @@ -1,1042 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2007-2012 by Jin-Hwan Cho and Shunsaku Hirata, - the dvipdfmx project team. - - Copyright (C) 1998, 1999 by Mark A. Wicks - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "system.h" -#include "numbers.h" -#include "error.h" -#include "mem.h" - -#include "dpxfile.h" -/* pdfdev... */ -#include "pdfdev.h" - -#include "tfm.h" -#include "dvi.h" -#include "vf.h" - -#include "dvicodes.h" - -#define VF_ALLOC_SIZE 16u - -#define VF_ID 202 -#define FIX_WORD_BASE 1048576.0 -#define TEXPT2PT (72.0/72.27) -#define FW2PT (TEXPT2PT/((double)(FIX_WORD_BASE))) - -static unsigned char verbose = 0; - -void vf_set_verbose(void) -{ - if (verbose < 255) verbose++; -} - -struct font_def { - signed long font_id /* id used internally in vf file */; - unsigned long checksum, size, design_size; - char *directory, *name; - int tfm_id; /* id returned by TFM module */ - int dev_id; /* id returned by DEV module */ -}; - -struct vf -{ - char *tex_name; - spt_t ptsize; - unsigned long design_size; /* A fixword-pts quantity */ - int num_dev_fonts, max_dev_fonts; - struct font_def *dev_fonts; - unsigned char **ch_pkt; - unsigned long *pkt_len; - unsigned num_chars; -}; - -struct vf *vf_fonts = NULL; -int num_vf_fonts = 0, max_vf_fonts = 0; - -static int read_header(FILE *vf_file, int thisfont) -{ - int i, result = 1, ch; - - /* Check for usual signature */ - if ((ch = get_unsigned_byte (vf_file)) == PRE && - (ch = get_unsigned_byte (vf_file)) == VF_ID) { - - /* If here, assume it's a legitimate vf file */ - ch = get_unsigned_byte (vf_file); - - /* skip comment */ - for (i=0; i max_vf_fonts) { - vf_fonts = RENEW (vf_fonts, size, struct vf); - for (i=max_vf_fonts; i (a_vf->num_chars)) { - size = MAX (size, a_vf->num_chars+256); - a_vf->ch_pkt = RENEW (a_vf->ch_pkt, size, unsigned char *); - a_vf->pkt_len = RENEW (a_vf->pkt_len, size, unsigned long); - for (i=a_vf->num_chars; ich_pkt)[i] = NULL; - (a_vf->pkt_len)[i] = 0; - } - a_vf->num_chars = size; - } -} - -static void read_a_char_def(FILE *vf_file, int thisfont, unsigned long pkt_len, - unsigned ch) -{ - unsigned char *pkt; -#ifdef DEBUG - fprintf (stderr, "read_a_char_def: len=%ld, ch=%d\n", pkt_len, ch); -#endif - /* Resize and initialize character arrays if necessary */ - if (ch >= vf_fonts[thisfont].num_chars) { - resize_one_vf_font (vf_fonts+thisfont, ch+1); - } - if (pkt_len > 0) { - pkt = NEW (pkt_len, unsigned char); - if (fread (pkt, 1, pkt_len, vf_file) != pkt_len) - ERROR ("VF file ended prematurely."); - (vf_fonts[thisfont].ch_pkt)[ch] = pkt; - } - (vf_fonts[thisfont].pkt_len)[ch] = pkt_len; - return; -} - -static void read_a_font_def(FILE *vf_file, signed long font_id, int thisfont) -{ - struct font_def *dev_font; - int dir_length, name_length; -#ifdef DEBUG - fprintf (stderr, "read_a_font_def: font_id = %ld\n", font_id); -#endif - if (vf_fonts[thisfont].num_dev_fonts >= - vf_fonts[thisfont].max_dev_fonts) { - vf_fonts[thisfont].max_dev_fonts += VF_ALLOC_SIZE; - vf_fonts[thisfont].dev_fonts = RENEW - (vf_fonts[thisfont].dev_fonts, - vf_fonts[thisfont].max_dev_fonts, - struct font_def); - } - dev_font = vf_fonts[thisfont].dev_fonts+ - vf_fonts[thisfont].num_dev_fonts; - dev_font -> font_id = font_id; - dev_font -> checksum = get_unsigned_quad (vf_file); - dev_font -> size = get_unsigned_quad (vf_file); - dev_font -> design_size = get_unsigned_quad (vf_file); - dir_length = get_unsigned_byte (vf_file); - name_length = get_unsigned_byte (vf_file); - dev_font -> directory = NEW (dir_length+1, char); - dev_font -> name = NEW (name_length+1, char); - fread (dev_font -> directory, 1, dir_length, vf_file); - fread (dev_font -> name, 1, name_length, vf_file); - (dev_font -> directory)[dir_length] = 0; - (dev_font -> name)[name_length] = 0; - vf_fonts[thisfont].num_dev_fonts += 1; - dev_font->tfm_id = tfm_open (dev_font -> name, 1); /* must exist */ - dev_font->dev_id = - dvi_locate_font (dev_font->name, - sqxfw (vf_fonts[thisfont].ptsize, - dev_font->size)); -#ifdef DEBUG - fprintf (stderr, "[%s/%s]\n", dev_font -> directory, dev_font -> name); -#endif - return; -} - - -static void process_vf_file (FILE *vf_file, int thisfont) -{ - int eof = 0, code; - unsigned long font_id; - while (!eof) { - code = get_unsigned_byte (vf_file); - switch (code) { - case FNT_DEF1: - font_id = get_unsigned_byte (vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - case FNT_DEF2: - font_id = get_unsigned_pair (vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - case FNT_DEF3: - font_id = get_unsigned_triple(vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - case FNT_DEF4: - font_id = get_signed_quad(vf_file); - read_a_font_def (vf_file, font_id, thisfont); - break; - default: - if (code < 242) { - long ch; - /* For a short packet, code is the pkt_len */ - ch = get_unsigned_byte (vf_file); - /* Skip over TFM width since we already know it */ - get_unsigned_triple (vf_file); - read_a_char_def (vf_file, thisfont, code, ch); - break; - } - if (code == 242) { - unsigned long pkt_len, ch; - pkt_len = get_unsigned_quad(vf_file); - ch = get_unsigned_quad (vf_file); - /* Skip over TFM width since we already know it */ - get_unsigned_quad (vf_file); - if (ch < 65536L) - read_a_char_def (vf_file, thisfont, pkt_len, ch); - else { - fprintf (stderr, "char=%ld\n", ch); - ERROR ("Long character (>16 bits) in VF file.\nI can't handle long characters!\n"); - } - break; - } - if (code == POST) { - eof = 1; - break; - } - fprintf (stderr, "Quitting on code=%d\n", code); - eof = 1; - break; - } - } - return; -} - -/* Unfortunately, the following code isn't smart enough - to load the vf only once for multiple point sizes. - You will get a separate copy of each VF in memory (and a separate - opening and reading of the file) for - each point size. Since VFs are pretty small, I guess - this is tolerable for now. In any case, - the PDF file will never repeat a physical font name */ -/* Note: This code needs to be able to recurse */ -/* Global variables such as num_vf_fonts require careful attention */ -int vf_locate_font (const char *tex_name, spt_t ptsize) -{ - int thisfont = -1, i; - char *full_vf_file_name; - FILE *vf_file; - /* Has this name and ptsize already been loaded as a VF? */ - for (i=0; i 1) - fprintf (stderr, "(VF:%s", full_vf_file_name); - if (num_vf_fonts >= max_vf_fonts) { - resize_vf_fonts (max_vf_fonts + VF_ALLOC_SIZE); - } - thisfont = num_vf_fonts++; - { /* Initialize some pointers and such */ - vf_fonts[thisfont].tex_name = NEW (strlen(tex_name)+1, char); - strcpy (vf_fonts[thisfont].tex_name, tex_name); - vf_fonts[thisfont].ptsize = ptsize; - vf_fonts[thisfont].num_chars = 0; - vf_fonts[thisfont].ch_pkt = NULL; - vf_fonts[thisfont].pkt_len = NULL; - } - read_header(vf_file, thisfont); - process_vf_file (vf_file, thisfont); - if (verbose) - fprintf (stderr, ")"); - MFCLOSE (vf_file); - } - if (full_vf_file_name) - RELEASE(full_vf_file_name); - } - return thisfont; -} - -#define next_byte() (*((*start)++)) -static UNSIGNED_BYTE unsigned_byte (unsigned char **start, unsigned char *end) -{ - UNSIGNED_BYTE byte = 0; - if (*start < end) - byte = next_byte(); - else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return byte; -} - -static SIGNED_BYTE signed_byte (unsigned char **start, unsigned char *end) -{ - int byte = 0; - if (*start < end) { - byte = next_byte(); - if (byte >= 0x80) - byte -= 0x100; - } - else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_BYTE) byte; -} - -static UNSIGNED_PAIR unsigned_pair (unsigned char **start, unsigned char *end) -{ - int i; - UNSIGNED_BYTE byte; - UNSIGNED_PAIR pair = 0; - if (end-*start > 1) { - for (i=0; i<2; i++) { - byte = next_byte(); - pair = pair*0x100u + byte; - } - } - else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return pair; -} - -static SIGNED_PAIR signed_pair (unsigned char **start, unsigned char *end) -{ - int i; - long pair = 0; - if (end - *start > 1) { - for (i=0; i<2; i++) { - pair = pair*0x100 + next_byte(); - } - if (pair >= 0x8000) { - pair -= 0x10000l; - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_PAIR) pair; -} - -static UNSIGNED_TRIPLE unsigned_triple(unsigned char **start, unsigned - char *end) -{ - int i; - long triple = 0; - if (end-*start > 2) { - for (i=0; i<3; i++) { - triple = triple*0x100u + next_byte(); - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (UNSIGNED_TRIPLE) triple; -} - -static SIGNED_TRIPLE signed_triple(unsigned char **start, unsigned char *end) -{ - int i; - long triple = 0; - if (end-*start > 2) { - for (i=0; i<3; i++) { - triple = triple*0x100 + next_byte(); - } - if (triple >= 0x800000l) - triple -= 0x1000000l; - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_TRIPLE) triple; -} - -static SIGNED_QUAD signed_quad(unsigned char **start, unsigned char *end) -{ - int byte, i; - long quad = 0; - /* Check sign on first byte before reading others */ - if (end-*start > 3) { - byte = next_byte(); - quad = byte; - if (quad >= 0x80) - quad = byte - 0x100; - for (i=0; i<3; i++) { - quad = quad*0x100 + next_byte(); - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (SIGNED_QUAD) quad; -} - -static UNSIGNED_QUAD unsigned_quad(unsigned char **start, unsigned char *end) -{ - int i; - unsigned long quad = 0; - if (end-*start > 3) { - for (i=0; i<4; i++) { - quad = quad*0x100u + next_byte(); - } - } else - ERROR ("Premature end of DVI byte stream in VF font\n"); - return (UNSIGNED_QUAD) quad; -} - -static void vf_set (SIGNED_QUAD ch) -{ - /* Defer to the dvi_set() defined in dvi.c */ - dvi_set (ch); - return; -} - -static void vf_set1(unsigned char **start, unsigned char *end) -{ - vf_set (unsigned_byte(start, end)); - return; -} - -static void vf_set2(unsigned char **start, unsigned char *end) -{ - vf_set (unsigned_pair(start, end)); - return; -} - -static void vf_putrule(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - SIGNED_QUAD width, height; - height = signed_quad (start, end); - width = signed_quad (start, end); - if (width > 0 && height > 0) { - dvi_rule (sqxfw(ptsize,width), sqxfw(ptsize, height)); - } - return; -} - -static void vf_setrule(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - SIGNED_QUAD width, height, s_width; - height = signed_quad (start, end); - width = signed_quad (start, end); - s_width = sqxfw(ptsize, width); - if (width > 0 && height > 0) { - dvi_rule (s_width, sqxfw(ptsize, height)); - } - dvi_right (s_width); - return; -} - -static void vf_put1(unsigned char **start, unsigned char *end) -{ - dvi_put (unsigned_byte(start, end)); - return; -} - -static void vf_put2(unsigned char **start, unsigned char *end) -{ - dvi_put (unsigned_pair(start, end)); - return; -} - -static void vf_push(void) -{ - dvi_push(); - return; -} - -static void vf_pop(void) -{ - dvi_pop(); - return; -} - -static void vf_right (SIGNED_QUAD x, spt_t ptsize) -{ - dvi_right ((SIGNED_QUAD) (sqxfw(ptsize, x))); - return; -} - - -static void vf_right1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_byte (start, end), ptsize); - return; -} - -static void vf_right2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_pair (start, end), ptsize); - return; -} - -static void vf_right3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_triple (start, end), ptsize); - return; -} - -static void vf_right4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_right (signed_quad (start, end), ptsize); - return; -} - -static void vf_w0(void) -{ - dvi_w0(); - return; -} - -static void vf_w (SIGNED_QUAD w, spt_t ptsize) -{ - dvi_w ((SIGNED_QUAD) (sqxfw(ptsize, w))); - return; -} - -static void vf_w1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_byte(start, end), ptsize); - return; -} - -static void vf_w2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_pair(start, end), ptsize); - return; -} - -static void vf_w3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_triple(start, end), ptsize); - return; -} - -static void vf_w4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_w (signed_quad(start, end), ptsize); - return; -} - -static void vf_x0(void) -{ - dvi_x0(); - return; -} - -static void vf_x (SIGNED_QUAD x, spt_t ptsize) -{ - dvi_x ((SIGNED_QUAD) (sqxfw(ptsize, x))); - return; -} - -static void vf_x1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_byte(start, end), ptsize); - return; -} - -static void vf_x2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_pair(start, end), ptsize); - return; -} - -static void vf_x3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_triple(start, end), ptsize); - return; -} - -static void vf_x4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_x (signed_quad(start, end), ptsize); - return; -} - -static void vf_down (SIGNED_QUAD y, spt_t ptsize) -{ - dvi_down ((SIGNED_QUAD) (sqxfw(ptsize, y))); - return; -} - -static void vf_down1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_byte(start, end), ptsize); - return; -} - -static void vf_down2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_pair(start, end), ptsize); - return; -} - -static void vf_down3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_triple(start, end), ptsize); - return; -} - -static void vf_down4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_down (signed_quad(start, end), ptsize); - return; -} - -static void vf_y0(void) -{ - dvi_y0(); - return; -} - -static void vf_y (SIGNED_QUAD y, spt_t ptsize) -{ - dvi_y ((SIGNED_QUAD) (sqxfw(ptsize, y))); - return; -} - - -static void vf_y1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_byte(start, end), ptsize); - return; -} - -static void vf_y2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_pair(start, end), ptsize); - return; -} - -static void vf_y3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_triple(start, end), ptsize); - return; -} - -static void vf_y4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_y (signed_quad(start, end), ptsize); - return; -} - -static void vf_z0(void) -{ - dvi_z0(); - return; -} - -static void vf_z (SIGNED_QUAD z, spt_t ptsize) -{ - dvi_z ((SIGNED_QUAD) (sqxfw(ptsize, z))); - return; -} - -static void vf_z1(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_byte(start, end), ptsize); - return; -} - -static void vf_z2(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_pair(start, end), ptsize); - return; -} - -static void vf_z3(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_triple(start, end), ptsize); - return; -} - -static void vf_z4(unsigned char **start, unsigned char *end, spt_t ptsize) -{ - vf_z (signed_quad(start, end), ptsize); - return; -} - -static void vf_fnt (SIGNED_QUAD font_id, unsigned long vf_font) -{ - int i; - for (i=0; i 0) - default_font = ((vf_fonts[vf_font].dev_fonts)[0]).dev_id; - dvi_vf_init (default_font); - if (ch >= vf_fonts[vf_font].num_chars || - !(start = (vf_fonts[vf_font].ch_pkt)[ch])) { - fprintf (stderr, "\nchar=0x%lx(%ld)\n", ch, ch); - fprintf (stderr, "Tried to set a nonexistent character in a virtual font"); - start = end = NULL; - } else { - end = start + (vf_fonts[vf_font].pkt_len)[ch]; - } - while (start && start < end) { - opcode = *(start++); -#ifdef DEBUG - fprintf (stderr, "VF opcode: %d", opcode); - if (isprint (opcode)) fprintf (stderr, " (\'%c\')\n", opcode); - else fprintf (stderr, "\n"); -#endif - switch (opcode) - { - case SET1: - vf_set1(&start, end); - break; - case SET2: - vf_set2(&start, end); - break; - case SET3: - case SET4: - ERROR ("Multibyte (>16 bits) character in VF packet.\nI can't handle this!"); - break; - case SET_RULE: - vf_setrule(&start, end, ptsize); - break; - case PUT1: - vf_put1(&start, end); - break; - case PUT2: - vf_put2(&start, end); - break; - case PUT3: - case PUT4: - ERROR ("Multibyte (>16 bits) character in VF packet.\nI can't handle this!"); - break; - case PUT_RULE: - vf_putrule(&start, end, ptsize); - break; - case NOP: - break; - case PUSH: - vf_push(); - break; - case POP: - vf_pop(); - break; - case RIGHT1: - vf_right1(&start, end, ptsize); - break; - case RIGHT2: - vf_right2(&start, end, ptsize); - break; - case RIGHT3: - vf_right3(&start, end, ptsize); - break; - case RIGHT4: - vf_right4(&start, end, ptsize); - break; - case W0: - vf_w0(); - break; - case W1: - vf_w1(&start, end, ptsize); - break; - case W2: - vf_w2(&start, end, ptsize); - break; - case W3: - vf_w3(&start, end, ptsize); - break; - case W4: - vf_w4(&start, end, ptsize); - break; - case X0: - vf_x0(); - break; - case X1: - vf_x1(&start, end, ptsize); - break; - case X2: - vf_x2(&start, end, ptsize); - break; - case X3: - vf_x3(&start, end, ptsize); - break; - case X4: - vf_x4(&start, end, ptsize); - break; - case DOWN1: - vf_down1(&start, end, ptsize); - break; - case DOWN2: - vf_down2(&start, end, ptsize); - break; - case DOWN3: - vf_down3(&start, end, ptsize); - break; - case DOWN4: - vf_down4(&start, end, ptsize); - break; - case Y0: - vf_y0(); - break; - case Y1: - vf_y1(&start, end, ptsize); - break; - case Y2: - vf_y2(&start, end, ptsize); - break; - case Y3: - vf_y3(&start, end, ptsize); - break; - case Y4: - vf_y4(&start, end, ptsize); - break; - case Z0: - vf_z0(); - break; - case Z1: - vf_z1(&start, end, ptsize); - break; - case Z2: - vf_z2(&start, end, ptsize); - break; - case Z3: - vf_z3(&start, end, ptsize); - break; - case Z4: - vf_z4(&start, end, ptsize); - break; - case FNT1: - vf_fnt1(&start, end, vf_font); - break; - case FNT2: - vf_fnt2(&start, end, vf_font); - break; - case FNT3: - vf_fnt3(&start, end, vf_font); - break; - case FNT4: - vf_fnt4(&start, end, vf_font); - break; - case XXX1: - vf_xxx1(&start, end); - break; - case XXX2: - vf_xxx2(&start, end); - break; - case XXX3: - vf_xxx3(&start, end); - break; - case XXX4: - vf_xxx4(&start, end); - break; - case PTEXDIR: - vf_dir(&start, end); - break; - default: - if (opcode <= SET_CHAR_127) { - vf_set (opcode); - } else if (opcode >= FNT_NUM_0 && opcode <= FNT_NUM_63) { - vf_fnt (opcode - FNT_NUM_0, vf_font); - } else { - fprintf (stderr, "Unexpected opcode: %d\n", opcode); - ERROR ("Unexpected opcode in vf file\n"); - } - } - } - dvi_vf_finish(); - } else { - fprintf (stderr, "vf_set_char: font: %d", vf_font); - ERROR ("Font not loaded\n"); - } - return; -} - - -void vf_close_all_fonts(void) -{ - unsigned long i; - int j; - struct font_def *one_font; - for (i=0; i directory); - RELEASE (one_font -> name); - } - if (vf_fonts[i].dev_fonts != NULL) - RELEASE (vf_fonts[i].dev_fonts); - } - if (vf_fonts != NULL) - RELEASE (vf_fonts); - return; -} diff --git a/Build/source/texk/dvipdfm-x/xsrc/xbb.h b/Build/source/texk/dvipdfm-x/xsrc/xbb.h deleted file mode 100644 index 5c8e25c1fd8..00000000000 --- a/Build/source/texk/dvipdfm-x/xsrc/xbb.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - - This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - - Copyright (C) 2008-2012 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, - the dvipdfmx project team. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -*/ - -#ifndef _XBB_H_ -#define _XBB_H_ - -#define EBB_OUTPUT 0 -#define XBB_OUTPUT 1 - -extern int extractbb(int argc, char *argv[], int mode); - -#endif /* _XBB_H_ */ -- cgit v1.2.3