diff options
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.c | 50 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.mk | 2 |
4 files changed, 54 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 9005dea6464..46ac83c7257 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -1071,7 +1071,7 @@ parse_options P2C(int, argc, string *, argv) } else if (ARGUMENT_IS ("version")) { char *versions; -#if defined (pdfTeX) +#if defined (pdfTeX) || defined(XeTeX) initversionstring(&versions); #else versions = NULL; diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c index 84f295f2570..39d0d14bfd1 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.c +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.c @@ -32,6 +32,11 @@ authorization from SIL International. * additional plain C extensions for XeTeX - mostly platform-neutral */ +#ifdef XETEX_OTHER +#include "xpdf/config.h" +#include "png.h" +#endif + #define EXTERN extern #include "xetexd.h" @@ -42,6 +47,11 @@ authorization from SIL International. #include "XeTeX_ext.h" +#include <ft2build.h> +#include FT_FREETYPE_H + +#include "zlib.h" + #include "TECkit_Engine.h" #include <kpathsea/c-ctype.h> @@ -165,6 +175,46 @@ string outputdriver = "xdvipdfmx -q -E"; /* else default to portable xdvipdfmx d #endif +void initversionstring(char **versions) +{ +#ifdef XETEX_OTHER + int fc_version = FcGetVersion(); +#endif + extern FT_Library gFreeTypeLibrary; /* in XeTeXFontInst_FT2 */ + FT_Int ftMajor, ftMinor, ftPatch; + if (gFreeTypeLibrary == 0 && FT_Init_FreeType(&gFreeTypeLibrary) != 0) { + fprintf(stderr, "FreeType initialization failed!\n"); + exit(9); + } + FT_Library_Version(gFreeTypeLibrary, &ftMajor, &ftMinor, &ftPatch); + + (void) asprintf(versions, + "Compiled with ICU version %s [with modifications for XeTeX]\n" + "Compiled with zlib version %s; using %s\n" + "Compiled with FreeType2 version %d.%d.%d; using %d.%d.%d\n" +#ifdef XETEX_MAC + "Using Mac OS X Carbon, Cocoa & QuickTime frameworks\n" +#else + "Compiled with fontconfig version %d.%d.%d; using %d.%d.%d\n" + "Compiled with libpng version %s; using %s\n" + "Compiled with xpdf version %s\n" +#endif + , + U_ICU_VERSION, + ZLIB_VERSION, zlib_version, + FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH, + ftMajor, ftMinor, ftPatch +#ifdef XETEX_OTHER + , + FC_VERSION / 10000, (FC_VERSION % 10000) / 100, FC_VERSION % 100, + fc_version / 10000, (fc_version % 10000) / 100, fc_version % 100, + PNG_LIBPNG_VER_STRING, png_libpng_ver, + xpdfVersion +#endif + ); +} + + extern char* gettexstring(int strNumber); void setinputfileencoding(UFILE* f, int mode, int encodingData) diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h index 3161d2fcfb9..45d71cca8d1 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h @@ -211,6 +211,8 @@ extern const UInt32 byteMark; #ifdef __cplusplus extern "C" { #endif + void initversionstring(char **versions); + void setinputfileencoding(unicodefile f, int mode, int encodingData); void uclose(unicodefile f); int input_line_icu(unicodefile f); diff --git a/Build/source/texk/web2c/xetexdir/xetex.mk b/Build/source/texk/web2c/xetexdir/xetex.mk index b7590af0427..87618443bd7 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.mk +++ b/Build/source/texk/web2c/xetexdir/xetex.mk @@ -187,7 +187,7 @@ XeTeXOTMath.o: $(srcdir)/xetexdir/XeTeXOTMath.cpp $(XeTeXFontHdrs) # special rules for files that need the TECkit headers as well XeTeX_ext.o: $(srcdir)/xetexdir/XeTeX_ext.c xetexd.h - $(compile) $(ICUCFLAGS) $(FTFLAGS) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ + $(compile) $(ICUCFLAGS) $(FTFLAGS) $(TECKITFLAGS) $(LIBPNGCPPFLAGS) $(LIBXPDFCPPFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ XeTeX_mac.o: $(srcdir)/xetexdir/XeTeX_mac.c xetexd.h $(compile) $(ICUCFLAGS) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ |