1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/automatic.cc lcdf-typetools-2.99/otftotfm/automatic.cc
--- lcdf-typetools-2.99.orig/otftotfm/automatic.cc 2013-09-10 11:05:27.000000000 +0200
+++ lcdf-typetools-2.99/otftotfm/automatic.cc 2013-09-10 19:13:50.000000000 +0200
@@ -39,6 +39,10 @@
#include <algorithm>
#ifdef WIN32
+#ifdef _MSC_VER
+# include <io.h>
+# include <direct.h>
+#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)
@@ -745,6 +760,14 @@
int slash = filename.find_right('\'');
if (slash >= 0)
filename = filename.substring(slash + 1);
+#if defined(W32TEX)
+// jtex_filetype is defined only in W32TeX
+ char *p = kpsei_var_value("jtex_filetype");
+ if (p != NULL) { // W32TeX
+ free(p);
+ String command = "updmap --nomkmap --add " + shell_quote(filename) + CMD_SEP " updmap";
+ } else // TeXLive
+#endif
String command = "updmap --nomkmap --enable Map " + shell_quote(filename) + CMD_SEP " updmap";
if (verbose)
command += " 1>&2";
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/kpseinterface.c lcdf-typetools-2.99/otftotfm/kpseinterface.c
--- lcdf-typetools-2.99.orig/otftotfm/kpseinterface.c 2013-09-11 08:54:18.000000000 +0200
+++ lcdf-typetools-2.99/otftotfm/kpseinterface.c 2013-09-11 09:02:02.000000000 +0200
@@ -21,6 +21,9 @@
#include <kpathsea/expand.h>
#include <kpathsea/c-pathch.h>
#include <kpathsea/tex-file.h>
+#ifdef W32TEX
+#include <kpathsea/variable.h>
+#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.99.orig/otftotfm/kpseinterface.h lcdf-typetools-2.99/otftotfm/kpseinterface.h
--- lcdf-typetools-2.99.orig/otftotfm/kpseinterface.h 2013-08-13 22:12:16.000000000 +0200
+++ lcdf-typetools-2.99/otftotfm/kpseinterface.h 2013-09-10 19:13:50.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.99.orig/otftotfm/otftotfm.cc lcdf-typetools-2.99/otftotfm/otftotfm.cc
--- lcdf-typetools-2.99.orig/otftotfm/otftotfm.cc 2013-09-10 11:00:57.000000000 +0200
+++ lcdf-typetools-2.99/otftotfm/otftotfm.cc 2013-09-10 19:13:50.000000000 +0200
@@ -63,6 +63,10 @@
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
+#ifdef _MSC_VER
+# include <io.h>
+#undef max
+#endif
using namespace Efont;
diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.99.orig/otftotfm/secondary.cc lcdf-typetools-2.99/otftotfm/secondary.cc
--- lcdf-typetools-2.99.orig/otftotfm/secondary.cc 2013-08-13 22:18:57.000000000 +0200
+++ lcdf-typetools-2.99/otftotfm/secondary.cc 2013-09-10 19:13:50.000000000 +0200
@@ -31,6 +31,10 @@
#include <errno.h>
#include <limits.h>
#include <algorithm>
+#ifdef _MSC_VER
+#undef max
+#undef min
+#endif
enum {
U_EXCLAMDOWN = 0x00A1, // U+00A1 INVERTED EXCLAMATION MARK
|