summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/bin/win32/dviout.bat7
-rw-r--r--Master/tlpkg/dviout/gen_pk25
2 files changed, 21 insertions, 11 deletions
diff --git a/Master/bin/win32/dviout.bat b/Master/bin/win32/dviout.bat
index f950efc9677..bd3a74485c2 100755
--- a/Master/bin/win32/dviout.bat
+++ b/Master/bin/win32/dviout.bat
@@ -35,6 +35,7 @@ set tfmpath=%tfmpath:!!=%
set tfmpath=%tfmpath:/=\%
rem Split font path var into arguments and rebuild it with only existing 'fonts' dirs
call :build_tfmpath ";" "%tfmpath:;=" "%"
+if "%tfmpath:~0,1%"==";" set tfmpath=%tfmpath:~1%
rem Use TL gostscript
set GS_LIB=%tlroot%\tlpkg\tlgs\fonts;%tlroot%\tlpkg\tlgs\lib;%tlroot%\tlpkg\tlgs\Resource
@@ -67,11 +68,7 @@ for /f "delims=;" %%I in ("%fontsdir%") do (set fontsdir=%%~sfI)
rem Continue if dir does not exist
if not exist "%fontsdir%\" goto :build_tfmpath
rem Add dir to path
-if not defined tfmpath (
- set tfmpath=%fontsdir%
-) else (
- set tfmpath=%tfmpath%;%fontsdir%
-)
+set tfmpath=%tfmpath%;%fontsdir%
goto :build_tfmpath
:no_tl
diff --git a/Master/tlpkg/dviout/gen_pk b/Master/tlpkg/dviout/gen_pk
index 2357e63c5d2..2d04b7c3b8e 100644
--- a/Master/tlpkg/dviout/gen_pk
+++ b/Master/tlpkg/dviout/gen_pk
@@ -1,8 +1,21 @@
%1st
-setlocal
-for %%I in (mktexpk.exe) do set "MKTEXPK_EXE=%%~$PATH:I"
-if not defined MKTEXPK_EXE exit 1
-%2nd
-"%MKTEXPK_EXE%" --mfmode / --dpi ^d --bdpi ^D --mag ^M "^s"
-%3rd
+setlocal enableextensions disabledelayedexpansion
+for %%I in (mktexpk.exe) do set "mktexpk=%%~$PATH:I"
+if not defined mktexpk exit 1
+for /f "usebackq skip=17 tokens=1,2,3* delims=|" %%I in (%0) do (
+ set dpi=%%I
+ set bdpi=%%J
+ set mag=%%K
+ set font=%%L
+ goto :sanitize
+)
+:sanitize
+if defined dpi set "dpi=%dpi:"=%"
+if defined bdpi set "bdpi=%bdpi:"=%"
+if defined mag set "mag=%mag:"=%"
+if defined font set "font=%font:"=%"
+"%mktexpk%" --mfmode / --dpi "%dpi%" --bdpi "%bdpi%" --mag "%mag%" "%font%"
del %0 & exit %errorlevel%
+%2nd
+^d|^D|^M|^s
+%3rd \ No newline at end of file