diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-08-13 15:12:13 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-08-13 15:12:13 +0000 |
commit | d5209d536850b6e29f0e67bc54f8fe02a897e10d (patch) | |
tree | 61d562f52bf30be33cf0099ea9cfe307e96782e7 | |
parent | d587b528504d1e2e5e8f13f998bdf02a54333041 (diff) |
lcdf-typetools: Remove TL vs W32TeX diffs (from Akira)
git-svn-id: svn://tug.org/texlive/trunk@27386 c570f23f-e606-0410-a88d-b1316a301751
7 files changed, 549 insertions, 1 deletions
diff --git a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.94-PATCHES/ChangeLog b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.94-PATCHES/ChangeLog index 70d1f284bf1..f03db7cc074 100644 --- a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.94-PATCHES/ChangeLog +++ b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.94-PATCHES/ChangeLog @@ -2,6 +2,7 @@ * patch-02-WIN32: More WIN32. * patch-20-TL-binary: More binary mode for output files. + * patch-30-W32TeX: W32TeX specific changes (from Akira). 2012-08-11 Peter Breitenlohner <peb@mppmu.mpg.de> diff --git a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.94-PATCHES/patch-30-W32TeX b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.94-PATCHES/patch-30-W32TeX new file mode 100644 index 00000000000..5abe4a18b15 --- /dev/null +++ b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.94-PATCHES/patch-30-W32TeX @@ -0,0 +1,339 @@ +diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.94.orig/libefont/psres.cc lcdf-typetools-2.94/libefont/psres.cc +--- lcdf-typetools-2.94.orig/libefont/psres.cc 2011-11-03 17:51:58.000000000 +0100 ++++ lcdf-typetools-2.94/libefont/psres.cc 2012-08-13 16:21:03.000000000 +0200 +@@ -36,6 +36,11 @@ + # endif + #endif + #include <string.h> ++ ++#ifdef W32TEX ++#include <windows.h> ++#endif ++ + namespace Efont { + + PsresDatabase::PsresDatabase() +diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.94.orig/otftotfm/automatic.cc lcdf-typetools-2.94/otftotfm/automatic.cc +--- lcdf-typetools-2.94.orig/otftotfm/automatic.cc 2012-08-13 13:40:24.000000000 +0200 ++++ lcdf-typetools-2.94/otftotfm/automatic.cc 2012-08-13 16:55:59.000000000 +0200 +@@ -124,7 +124,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 +756,14 @@ + int slash = filename.find_right('\''); + if (slash >= 0) + filename = filename.substring(slash + 1); ++#if defined(W32TEX) ++// guess_input_kanji_encoding is defined only in W32TeX ++ char *p = kpsei_var_value("guess_input_kanji_encoding"); ++ 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.94.orig/otftotfm/kpseinterface.c lcdf-typetools-2.94/otftotfm/kpseinterface.c +--- lcdf-typetools-2.94.orig/otftotfm/kpseinterface.c 2011-11-03 17:51:58.000000000 +0100 ++++ lcdf-typetools-2.94/otftotfm/kpseinterface.c 2012-08-13 17:05:15.000000000 +0200 +@@ -11,24 +11,112 @@ + * Public License for more details. + */ + ++/* The W32TEX version does not link to Kpathsea, but uses the DLL ++ * built by MSVC. ++ */ ++ ++#if !defined(W32TEX) + #include <kpathsea/config.h> ++#endif + #ifdef HAVE_CONFIG_H + # include <config.h> + #endif + #include <stdio.h> + #include <stdlib.h> ++#ifdef W32TEX ++#define ENV_SEP ';' ++#include <windows.h> ++extern HINSTANCE Hinstance; ++#else + #include <kpathsea/progname.h> + #include <kpathsea/expand.h> + #include <kpathsea/c-pathch.h> + #include <kpathsea/tex-file.h> ++#endif + #include "kpseinterface.h" + + int kpsei_env_sep_char = ENV_SEP; + ++#ifdef W32TEX ++typedef enum ++{ ++ kpse_gf_format, ++ kpse_pk_format, ++ kpse_any_glyph_format, /* ``any'' meaning gf or pk */ ++ kpse_tfm_format, ++ kpse_afm_format, ++ kpse_base_format, ++ kpse_bib_format, ++ kpse_bst_format, ++ kpse_cnf_format, ++ kpse_db_format, ++ kpse_fmt_format, ++ kpse_fontmap_format, ++ kpse_mem_format, ++ kpse_mf_format, ++ kpse_mfpool_format, ++ kpse_mft_format, ++ kpse_mp_format, ++ kpse_mppool_format, ++ kpse_mpsupport_format, ++ kpse_ocp_format, ++ kpse_ofm_format, ++ kpse_opl_format, ++ kpse_otp_format, ++ kpse_ovf_format, ++ kpse_ovp_format, ++ kpse_pict_format, ++ kpse_tex_format, ++ kpse_texdoc_format, ++ kpse_texpool_format, ++ kpse_texsource_format, ++ kpse_tex_ps_header_format, ++ kpse_troff_font_format, ++ kpse_type1_format, ++ kpse_vf_format, ++ kpse_dvips_config_format, ++ kpse_ist_format, ++ kpse_truetype_format, ++ kpse_type42_format, ++ kpse_web2c_format, ++ kpse_program_text_format, ++ kpse_program_binary_format, ++ kpse_miscfonts_format, ++ kpse_web_format, ++ kpse_cweb_format, ++ kpse_enc_format, ++ kpse_cmap_format, ++ kpse_sfd_format, ++ kpse_opentype_format, ++ kpse_pdftex_config_format, ++ kpse_lig_format, ++ kpse_texmfscripts_format, ++ kpse_lua_format, ++ kpse_fea_format, ++ kpse_cid_format, ++ kpse_mlbib_format, ++ kpse_mlbst_format, ++ kpse_clua_format, ++ kpse_ris_format, ++ kpse_bltxml_format, ++ kpse_last_format /* one past last index */ ++} kpse_file_format_type; ++#endif ++ + void + kpsei_init(const char* argv0, const char* progname) + { ++#ifdef W32TEX ++ PROC pkpse_set_program_name; ++ pkpse_set_program_name = GetProcAddress(Hinstance, "kpse_set_program_name"); ++ if(!pkpse_set_program_name) { ++ fprintf(stderr, "Failed to find Kpathsea function.\n"); ++ return; ++ } ++ (void)pkpse_set_program_name(argv0, progname); ++#else + kpse_set_program_name(argv0, progname); ++#endif + #ifdef SELFAUTODIR + putenv("SELFAUTODIR=" SELFAUTODIR); + #endif +@@ -43,12 +131,34 @@ + char* + kpsei_path_expand(const char* path) + { ++#ifdef W32TEX ++ PROC pkpse_path_expand; ++ pkpse_path_expand = GetProcAddress(Hinstance, "kpse_path_expand"); ++ if(!pkpse_path_expand) { ++ fprintf(stderr, "Failed to find Kpathsea function.\n"); ++ return 0; ++ } ++ return (char *)pkpse_path_expand(path); ++#else + return kpse_path_expand(path); ++#endif + } + ++#ifdef W32TEX ++#define kpse_find_file (char *)pkpse_find_file ++#endif ++ + char* + kpsei_find_file(const char* name, int format) + { ++#ifdef W32TEX ++ PROC pkpse_find_file; ++ pkpse_find_file = GetProcAddress(Hinstance, "kpse_find_file"); ++ if(!pkpse_find_file) { ++ fprintf(stderr, "Failed to find Kpathsea function.\n"); ++ return 0; ++ } ++#endif + switch (format) { + case KPSEI_FMT_WEB2C: + return kpse_find_file(name, kpse_web2c_format, true); +@@ -76,5 +186,41 @@ + void + kpsei_set_debug_flags(unsigned flags) + { ++#ifdef W32TEX ++ unsigned int *pkpathsea_debug; ++ pkpathsea_debug = (unsigned int *)GetProcAddress(Hinstance, "kpathsea_debug"); ++ if(!pkpathsea_debug) { ++ fprintf(stderr, "Failed to find Kpathsea variable.\n"); ++ return; ++ } ++ *pkpathsea_debug = flags; ++#else + kpathsea_debug = flags; ++#endif ++} ++ ++#ifdef W32TEX ++int ++kpsei_getlongpath(char *buff, char *input, int len) ++{ ++ PROC pkpse_getlongpath; ++ pkpse_getlongpath = GetProcAddress(Hinstance, "getlongpath"); ++ if(!pkpse_getlongpath) { ++ fprintf(stderr, "Failed to find Kpathsea function.\n"); ++ return 0; ++ } ++ return (int)pkpse_getlongpath(buff, input, len); + } ++ ++char * ++kpsei_var_value(const char *var) ++{ ++ PROC pkpse_var_value; ++ pkpse_var_value = GetProcAddress(Hinstance, "kpse_var_value"); ++ if(!pkpse_var_value) { ++ fprintf(stderr, "Failed to find Kpathsea function.\n"); ++ return NULL; ++ } ++ return (char *)pkpse_var_value(var); ++} ++#endif +diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.94.orig/otftotfm/kpseinterface.h lcdf-typetools-2.94/otftotfm/kpseinterface.h +--- lcdf-typetools-2.94.orig/otftotfm/kpseinterface.h 2011-11-03 17:51:58.000000000 +0100 ++++ lcdf-typetools-2.94/otftotfm/kpseinterface.h 2012-08-13 16:22:26.000000000 +0200 +@@ -13,6 +13,13 @@ + char* kpsei_find_file(const char* name, int format); + void kpsei_set_debug_flags(unsigned flags); + ++#ifdef W32TEX ++int kpsei_getlongpath(char *buff, char *input, int len); ++char *kpsei_var_value(const char *var); ++#define true 1 ++#define false 0 ++#endif ++ + #ifdef __cplusplus + } + #endif +diff -ur -x Makefile.in -x aclocal.m4 -x autoconf.h.in -x configure lcdf-typetools-2.94.orig/otftotfm/otftotfm.cc lcdf-typetools-2.94/otftotfm/otftotfm.cc +--- lcdf-typetools-2.94.orig/otftotfm/otftotfm.cc 2012-08-11 18:07:57.000000000 +0200 ++++ lcdf-typetools-2.94/otftotfm/otftotfm.cc 2012-08-13 16:30:04.000000000 +0200 +@@ -1739,6 +1739,11 @@ + } + } + ++#ifdef W32TEX ++#include <windows.h> ++HINSTANCE Hinstance; ++#endif ++ + int + main(int argc, char *argv[]) + { +@@ -1750,6 +1755,15 @@ + Clp_AddType(clp, CHAR_OPTTYPE, 0, clp_parse_char, 0); + program_name = Clp_ProgramName(clp); + #if HAVE_KPATHSEA ++#ifdef W32TEX ++ Hinstance = LoadLibrary(KPSEDLLNAME); ++ if(Hinstance == NULL) ++ Hinstance = LoadLibrary(KPSEOLDDLLNAME); ++ if(Hinstance == NULL) { ++ fprintf(stderr, "I cannot load Kpathsea dynamic library.\n"); ++ return 100; ++ } ++#endif + kpsei_init(argv[0], "lcdftools"); + #endif + #ifdef HAVE_CTIME +@@ -2121,11 +2135,19 @@ + This is free software; see the source for copying conditions.\n\ + There is NO warranty, not even for merchantability or fitness for a\n\ + particular purpose.\n"); ++#ifdef W32TEX ++ if(Hinstance != NULL) ++ FreeLibrary(Hinstance); ++#endif + exit(0); + break; + + case HELP_OPT: + usage(); ++#ifdef W32TEX ++ if(Hinstance != NULL) ++ FreeLibrary(Hinstance); ++#endif + exit(0); + break; + +@@ -2181,8 +2203,13 @@ + try { + // read font + otf_data = read_file(input_file, errh); +- if (errh->nerrors()) ++ if (errh->nerrors()) { ++#ifdef W32TEX ++ if(Hinstance != NULL) ++ FreeLibrary(Hinstance); ++#endif + exit(1); ++ } + + LandmarkErrorHandler cerrh(errh, printable_filename(input_file)); + BailErrorHandler bail_errh(&cerrh); +@@ -2271,6 +2298,10 @@ + } catch (OpenType::Error e) { + errh->error("unhandled exception %<%s%>", e.description.c_str()); + } ++#ifdef W32TEX ++ if(Hinstance != NULL) ++ FreeLibrary(Hinstance); ++#endif + + return (errh->nerrors() == 0 ? 0 : 1); + } diff --git a/Build/source/texk/lcdf-typetools/libefont/psres.cc b/Build/source/texk/lcdf-typetools/libefont/psres.cc index 5bdfd652263..4905205675f 100644 --- a/Build/source/texk/lcdf-typetools/libefont/psres.cc +++ b/Build/source/texk/lcdf-typetools/libefont/psres.cc @@ -36,6 +36,11 @@ # endif #endif #include <string.h> + +#ifdef W32TEX +#include <windows.h> +#endif + namespace Efont { PsresDatabase::PsresDatabase() diff --git a/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc b/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc index f6222122c93..aa74f6006a3 100644 --- a/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc +++ b/Build/source/texk/lcdf-typetools/otftotfm/automatic.cc @@ -124,7 +124,18 @@ look_for_writable_texdir(const char *path_variable, bool create) 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 +756,14 @@ update_autofont_map(const String &fontname, String mapline, ErrorHandler *errh) int slash = filename.find_right('\''); if (slash >= 0) filename = filename.substring(slash + 1); +#if defined(W32TEX) +// guess_input_kanji_encoding is defined only in W32TeX + char *p = kpsei_var_value("guess_input_kanji_encoding"); + 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 --git a/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.c b/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.c index 7616bf7aa44..0dbee2b3f0b 100644 --- a/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.c +++ b/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.c @@ -11,24 +11,112 @@ * Public License for more details. */ +/* The W32TEX version does not link to Kpathsea, but uses the DLL + * built by MSVC. + */ + +#if !defined(W32TEX) #include <kpathsea/config.h> +#endif #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <stdio.h> #include <stdlib.h> +#ifdef W32TEX +#define ENV_SEP ';' +#include <windows.h> +extern HINSTANCE Hinstance; +#else #include <kpathsea/progname.h> #include <kpathsea/expand.h> #include <kpathsea/c-pathch.h> #include <kpathsea/tex-file.h> +#endif #include "kpseinterface.h" int kpsei_env_sep_char = ENV_SEP; +#ifdef W32TEX +typedef enum +{ + kpse_gf_format, + kpse_pk_format, + kpse_any_glyph_format, /* ``any'' meaning gf or pk */ + kpse_tfm_format, + kpse_afm_format, + kpse_base_format, + kpse_bib_format, + kpse_bst_format, + kpse_cnf_format, + kpse_db_format, + kpse_fmt_format, + kpse_fontmap_format, + kpse_mem_format, + kpse_mf_format, + kpse_mfpool_format, + kpse_mft_format, + kpse_mp_format, + kpse_mppool_format, + kpse_mpsupport_format, + kpse_ocp_format, + kpse_ofm_format, + kpse_opl_format, + kpse_otp_format, + kpse_ovf_format, + kpse_ovp_format, + kpse_pict_format, + kpse_tex_format, + kpse_texdoc_format, + kpse_texpool_format, + kpse_texsource_format, + kpse_tex_ps_header_format, + kpse_troff_font_format, + kpse_type1_format, + kpse_vf_format, + kpse_dvips_config_format, + kpse_ist_format, + kpse_truetype_format, + kpse_type42_format, + kpse_web2c_format, + kpse_program_text_format, + kpse_program_binary_format, + kpse_miscfonts_format, + kpse_web_format, + kpse_cweb_format, + kpse_enc_format, + kpse_cmap_format, + kpse_sfd_format, + kpse_opentype_format, + kpse_pdftex_config_format, + kpse_lig_format, + kpse_texmfscripts_format, + kpse_lua_format, + kpse_fea_format, + kpse_cid_format, + kpse_mlbib_format, + kpse_mlbst_format, + kpse_clua_format, + kpse_ris_format, + kpse_bltxml_format, + kpse_last_format /* one past last index */ +} kpse_file_format_type; +#endif + void kpsei_init(const char* argv0, const char* progname) { +#ifdef W32TEX + PROC pkpse_set_program_name; + pkpse_set_program_name = GetProcAddress(Hinstance, "kpse_set_program_name"); + if(!pkpse_set_program_name) { + fprintf(stderr, "Failed to find Kpathsea function.\n"); + return; + } + (void)pkpse_set_program_name(argv0, progname); +#else kpse_set_program_name(argv0, progname); +#endif #ifdef SELFAUTODIR putenv("SELFAUTODIR=" SELFAUTODIR); #endif @@ -43,12 +131,34 @@ kpsei_init(const char* argv0, const char* progname) char* kpsei_path_expand(const char* path) { +#ifdef W32TEX + PROC pkpse_path_expand; + pkpse_path_expand = GetProcAddress(Hinstance, "kpse_path_expand"); + if(!pkpse_path_expand) { + fprintf(stderr, "Failed to find Kpathsea function.\n"); + return 0; + } + return (char *)pkpse_path_expand(path); +#else return kpse_path_expand(path); +#endif } +#ifdef W32TEX +#define kpse_find_file (char *)pkpse_find_file +#endif + char* kpsei_find_file(const char* name, int format) { +#ifdef W32TEX + PROC pkpse_find_file; + pkpse_find_file = GetProcAddress(Hinstance, "kpse_find_file"); + if(!pkpse_find_file) { + fprintf(stderr, "Failed to find Kpathsea function.\n"); + return 0; + } +#endif switch (format) { case KPSEI_FMT_WEB2C: return kpse_find_file(name, kpse_web2c_format, true); @@ -76,5 +186,41 @@ kpsei_find_file(const char* name, int format) void kpsei_set_debug_flags(unsigned flags) { +#ifdef W32TEX + unsigned int *pkpathsea_debug; + pkpathsea_debug = (unsigned int *)GetProcAddress(Hinstance, "kpathsea_debug"); + if(!pkpathsea_debug) { + fprintf(stderr, "Failed to find Kpathsea variable.\n"); + return; + } + *pkpathsea_debug = flags; +#else kpathsea_debug = flags; +#endif +} + +#ifdef W32TEX +int +kpsei_getlongpath(char *buff, char *input, int len) +{ + PROC pkpse_getlongpath; + pkpse_getlongpath = GetProcAddress(Hinstance, "getlongpath"); + if(!pkpse_getlongpath) { + fprintf(stderr, "Failed to find Kpathsea function.\n"); + return 0; + } + return (int)pkpse_getlongpath(buff, input, len); } + +char * +kpsei_var_value(const char *var) +{ + PROC pkpse_var_value; + pkpse_var_value = GetProcAddress(Hinstance, "kpse_var_value"); + if(!pkpse_var_value) { + fprintf(stderr, "Failed to find Kpathsea function.\n"); + return NULL; + } + return (char *)pkpse_var_value(var); +} +#endif diff --git a/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.h b/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.h index 0809059437b..c822a24fa1e 100644 --- a/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.h +++ b/Build/source/texk/lcdf-typetools/otftotfm/kpseinterface.h @@ -13,6 +13,13 @@ enum { KPSEI_FMT_WEB2C, KPSEI_FMT_ENCODING, KPSEI_FMT_TYPE1, char* kpsei_find_file(const char* name, int format); void kpsei_set_debug_flags(unsigned flags); +#ifdef W32TEX +int kpsei_getlongpath(char *buff, char *input, int len); +char *kpsei_var_value(const char *var); +#define true 1 +#define false 0 +#endif + #ifdef __cplusplus } #endif diff --git a/Build/source/texk/lcdf-typetools/otftotfm/otftotfm.cc b/Build/source/texk/lcdf-typetools/otftotfm/otftotfm.cc index e2eb62f1f71..f4fe4a512a7 100644 --- a/Build/source/texk/lcdf-typetools/otftotfm/otftotfm.cc +++ b/Build/source/texk/lcdf-typetools/otftotfm/otftotfm.cc @@ -1739,6 +1739,11 @@ parse_base_encodings(const String &filename, ErrorHandler *errh) } } +#ifdef W32TEX +#include <windows.h> +HINSTANCE Hinstance; +#endif + int main(int argc, char *argv[]) { @@ -1750,6 +1755,15 @@ main(int argc, char *argv[]) Clp_AddType(clp, CHAR_OPTTYPE, 0, clp_parse_char, 0); program_name = Clp_ProgramName(clp); #if HAVE_KPATHSEA +#ifdef W32TEX + Hinstance = LoadLibrary(KPSEDLLNAME); + if(Hinstance == NULL) + Hinstance = LoadLibrary(KPSEOLDDLLNAME); + if(Hinstance == NULL) { + fprintf(stderr, "I cannot load Kpathsea dynamic library.\n"); + return 100; + } +#endif kpsei_init(argv[0], "lcdftools"); #endif #ifdef HAVE_CTIME @@ -2121,11 +2135,19 @@ main(int argc, char *argv[]) This is free software; see the source for copying conditions.\n\ There is NO warranty, not even for merchantability or fitness for a\n\ particular purpose.\n"); +#ifdef W32TEX + if(Hinstance != NULL) + FreeLibrary(Hinstance); +#endif exit(0); break; case HELP_OPT: usage(); +#ifdef W32TEX + if(Hinstance != NULL) + FreeLibrary(Hinstance); +#endif exit(0); break; @@ -2181,8 +2203,13 @@ particular purpose.\n"); try { // read font otf_data = read_file(input_file, errh); - if (errh->nerrors()) + if (errh->nerrors()) { +#ifdef W32TEX + if(Hinstance != NULL) + FreeLibrary(Hinstance); +#endif exit(1); + } LandmarkErrorHandler cerrh(errh, printable_filename(input_file)); BailErrorHandler bail_errh(&cerrh); @@ -2271,6 +2298,10 @@ particular purpose.\n"); } catch (OpenType::Error e) { errh->error("unhandled exception %<%s%>", e.description.c_str()); } +#ifdef W32TEX + if(Hinstance != NULL) + FreeLibrary(Hinstance); +#endif return (errh->nerrors() == 0 ? 0 : 1); } |