diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.104.orig/otftotfm/automatic.cc lcdf-typetools-2.104/otftotfm/automatic.cc --- lcdf-typetools-2.104.orig/otftotfm/automatic.cc 2014-07-05 11:53:11.000000000 +0200 +++ lcdf-typetools-2.104/otftotfm/automatic.cc 2014-07-05 11:54:07.000000000 +0200 @@ -39,6 +39,10 @@ #include #ifdef WIN32 +#ifdef _MSC_VER +# include +# include +#endif # define mkdir(dir, access) mkdir(dir) # define COPY_CMD "copy" # define CMD_SEP "&" @@ -124,7 +128,18 @@ static void find_writable_texdir(ErrorHandler *errh, const char *) { +#if defined(W32TEX) +// W32TeX does not have TEXMFVAR + char *p = kpsei_var_value("TEXMFVAR"); + if (p == NULL) // W32TeX + look_for_writable_texdir("$TEXMFLOCAL", true); + else { // TeXLive + free (p); + look_for_writable_texdir("$TEXMFVAR", true); + } +#else look_for_writable_texdir("$TEXMFVAR", true); +#endif if (!writable_texdir) look_for_writable_texdir("$VARTEXMF", false); if (!writable_texdir) @@ -744,7 +759,16 @@ if (slash >= 0) filename = filename.substring(slash + 1); String redirect = verbose ? " 1>&2" : " >" DEV_NULL " 2>&1"; - String command = "updmap --nomkmap --enable Map " + shell_quote(filename) + redirect +#if defined(W32TEX) +// jtex_filetype is defined only in W32TeX + char *p = kpsei_var_value("jtex_filetype"); + if (p != NULL) { // W32TeX + free(p); + String option = "--add "; + } else // TeXLive +#endif + String option = "--enable Map "; + String command = "updmap --nomkmap " + option + shell_quote(filename) + redirect + CMD_SEP " updmap" + redirect; int retval = mysystem(command.c_str(), errh); if (retval == 127) diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.104.orig/otftotfm/kpseinterface.c lcdf-typetools-2.104/otftotfm/kpseinterface.c --- lcdf-typetools-2.104.orig/otftotfm/kpseinterface.c 2014-04-10 14:27:02.000000000 +0200 +++ lcdf-typetools-2.104/otftotfm/kpseinterface.c 2014-07-05 11:54:07.000000000 +0200 @@ -21,6 +21,9 @@ #include #include #include +#ifdef W32TEX +#include +#endif #include "kpseinterface.h" int kpsei_env_sep_char = ENV_SEP; @@ -86,3 +89,11 @@ { kpathsea_debug = flags; } + +#ifdef W32TEX +char* +kpsei_var_value(const char *name) +{ + return kpse_var_value(name); +} +#endif diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.104.orig/otftotfm/kpseinterface.h lcdf-typetools-2.104/otftotfm/kpseinterface.h --- lcdf-typetools-2.104.orig/otftotfm/kpseinterface.h 2013-09-17 15:27:20.000000000 +0200 +++ lcdf-typetools-2.104/otftotfm/kpseinterface.h 2014-07-05 11:54:07.000000000 +0200 @@ -13,6 +13,10 @@ char* kpsei_find_file(const char* name, int format); void kpsei_set_debug_flags(unsigned flags); +#ifdef W32TEX +char* kpsei_var_value(const char *name); +#endif + #ifdef __cplusplus } #endif diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.104.orig/otftotfm/otftotfm.cc lcdf-typetools-2.104/otftotfm/otftotfm.cc --- lcdf-typetools-2.104.orig/otftotfm/otftotfm.cc 2014-07-07 08:32:34.000000000 +0200 +++ lcdf-typetools-2.104/otftotfm/otftotfm.cc 2014-07-07 08:34:35.000000000 +0200 @@ -63,6 +63,9 @@ #ifdef HAVE_FCNTL_H # include #endif +#ifdef _MSC_VER +# include +#endif using namespace Efont;