summaryrefslogtreecommitdiff
path: root/graphics/MF-PS/progs
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/MF-PS/progs
Initial commit
Diffstat (limited to 'graphics/MF-PS/progs')
-rw-r--r--graphics/MF-PS/progs/0progs.doc25
l---------graphics/MF-PS/progs/README1
-rw-r--r--graphics/MF-PS/progs/e2m.bat11
-rw-r--r--graphics/MF-PS/progs/m2e-alt.bat30
-rw-r--r--graphics/MF-PS/progs/m2e.bat26
-rw-r--r--graphics/MF-PS/progs/spliteps.awk9
-rw-r--r--graphics/MF-PS/progs/spliteps.tex83
-rw-r--r--graphics/MF-PS/progs/tex.bat8
8 files changed, 193 insertions, 0 deletions
diff --git a/graphics/MF-PS/progs/0progs.doc b/graphics/MF-PS/progs/0progs.doc
new file mode 100644
index 0000000000..d864a8ed72
--- /dev/null
+++ b/graphics/MF-PS/progs/0progs.doc
@@ -0,0 +1,25 @@
+This file belongs to the MFTOEPS package.
+
+The directory PROGS contains the following files:
+ 0PROGS.DOC this file
+ E2M.BAT canonical DOS batch file for converting EPS files to
+ MF ones; uses AWK
+ M2E.BAT canonical DOS batch file for generating EPS files; uses AWK
+ M2E-ALT.BAT alternative DOS batch file for generating EPS files; uses TeX
+ SPLITEPS.AWK AWK program used by M2E.BAT
+ SPLITEPS.TEX TeX program used by M2E-ALT.BAT
+ TEX.BAT sample DOS batch file calling TeX used by M2E-ALT.BAT
+
+Some of these files may require adjustments to the needs
+of a particular system.
+
+You are entitled to do with these files whatever you wish. If you alter
+a file, however, please remove the line containing the comment:
+
+ `This file belongs to the MFTOEPS package.'
+
+in order to avoid mess.
+
+-----------------------------------------------------------------------------
+
+END OF THE 0PROGS.DOC FILE
diff --git a/graphics/MF-PS/progs/README b/graphics/MF-PS/progs/README
new file mode 120000
index 0000000000..db7eb0690c
--- /dev/null
+++ b/graphics/MF-PS/progs/README
@@ -0,0 +1 @@
+0progs.doc \ No newline at end of file
diff --git a/graphics/MF-PS/progs/e2m.bat b/graphics/MF-PS/progs/e2m.bat
new file mode 100644
index 0000000000..7fec349783
--- /dev/null
+++ b/graphics/MF-PS/progs/e2m.bat
@@ -0,0 +1,11 @@
+:: This file belongs to the MFTOEPS package.
+::
+:: %1 is an input file name WITH extension
+:: %2 is an output file name WITH extension
+::
+:: Software used (change if required):
+:: GAWK.EXE or (better) GAWK32.EXE, ver. 3.0.x
+::
+@echo off
+:: gawk -f epstomf.awk %1 > %2
+gawk32 -f epstomf.awk %1 > %2
diff --git a/graphics/MF-PS/progs/m2e-alt.bat b/graphics/MF-PS/progs/m2e-alt.bat
new file mode 100644
index 0000000000..c96c568f88
--- /dev/null
+++ b/graphics/MF-PS/progs/m2e-alt.bat
@@ -0,0 +1,30 @@
+::
+:: This file belongs to the MFTOEPS package.
+::
+@echo off
+::
+:: %1 is a file name WITHOUT extension
+::
+:: This batch is an alternative to M2E.BAT using TeX rather than AWK
+::
+:: Software used (change if required):
+:: MF386.EXE
+:: TEX.BAT (TEX.BAT calls TeX, because calling TeX may be
+:: configuration-dependent; see sample TEX.BAT)
+:: GFTODVI.EXE
+::
+ mf386 &plain \yeseps:=1; input %1
+ if errorlevel==1 goto EMERG
+ call tex.bat \def\inputname{%1.log}\input spliteps.tex
+ if exist %1.300 goto NOPSMODE
+ goto CLEANUP
+:NOPSMODE
+:: `no_export_level' was used for some reason (error?)...
+ gftodvi %1.300
+ if exist %1.300 del %1.300
+ if exist %1.tfm del %1.tfm
+ if exist %1.eps del %1.eps
+:CLEANUP
+ if exist spliteps.log del spliteps.log
+:: del %1.log
+:EMERG
diff --git a/graphics/MF-PS/progs/m2e.bat b/graphics/MF-PS/progs/m2e.bat
new file mode 100644
index 0000000000..53a5aad72a
--- /dev/null
+++ b/graphics/MF-PS/progs/m2e.bat
@@ -0,0 +1,26 @@
+:: This file belongs to the MFTOEPS package.
+::
+@echo off
+::
+:: %1 is a file name WITHOUT extension
+::
+:: Software used (change if required):
+:: MF386.EXE
+:: GAWK.EXE or (better) GAWK32.EXE, ver. 3.0.x
+:: GFTODVI.EXE
+::
+ mf386 &plain \yeseps:=1; input %1
+ if errorlevel==1 goto EMERG
+:: gawk -f spliteps.awk %1.log
+ gawk32 -f spliteps.awk %1.log
+ if exist %1.300 goto NOPSMODE
+ goto CLEANUP
+:NOPSMODE
+:: `no_export_level' was used for some reason (error?)...
+ gftodvi %1.300
+ if exist %1.300 del %1.300
+ if exist %1.tfm del %1.tfm
+ if exist %1.eps del %1.eps
+:CLEANUP
+:: del %1.log
+:EMERG
diff --git a/graphics/MF-PS/progs/spliteps.awk b/graphics/MF-PS/progs/spliteps.awk
new file mode 100644
index 0000000000..f14733c2a6
--- /dev/null
+++ b/graphics/MF-PS/progs/spliteps.awk
@@ -0,0 +1,9 @@
+#
+# This file belongs to the MFTOEPS package.
+#
+# AWK program to be used by M2E.BAT
+#
+BEGIN {N=""}
+$0 ~ /^:EPS FILE NAME: / {
+ if (NF==3) {N="vicar.eps"} else {N=$NF ".eps"} print "extracting " N}
+$0 ~ /^:PS: / {print substr($0,6) > N}
diff --git a/graphics/MF-PS/progs/spliteps.tex b/graphics/MF-PS/progs/spliteps.tex
new file mode 100644
index 0000000000..f1503eaeb6
--- /dev/null
+++ b/graphics/MF-PS/progs/spliteps.tex
@@ -0,0 +1,83 @@
+%
+% This file belongs to the MFTOEPS package.
+%
+% TeX file approximately emulating the following AWK program:
+% BEGIN {N=""}
+% $0 ~ /^:EPS FILE NAME: / {
+% if (NF==3) {N="vicar.eps"} else {N=$NF ".eps"} print "extracting " N}
+% $0 ~ /^:PS: / {print substr($0,6) > N}
+% (see SPLITEPS.AWK)
+%
+% REMARK: it was a suggestion of Phil Taylor to use TeX instead of AWK.
+
+\ifx\inputname\undefined \errmessage{\noexpand\inputname NOT DEFINED}\fi
+\newread\currentinput \immediate\openin\currentinput\inputname\relax
+\ifeof\currentinput \errmessage{FILE \inputname\space NOT FOUND}\fi
+
+\newwrite\currentoutput
+
+\newif\ifcontinueloop
+\newif\ifoutputopen \outputopenfalse
+
+\def\EPSfirstline{EPS FILE NAME}
+\def\EPSline{PS}
+
+\def\gobblespace#1{#1}
+\def\truncatekey#1:#2:#3\relax{%
+ \def\linecontents{#3}%
+ \ifx\linecontents\empty
+ \else
+ \edef\linecontents{\expandafter\gobblespace\linecontents}%
+ \fi}
+
+\long\def\getkey#1:#2:{\gdef\prekey{#1}\gdef\key{#2}}
+
+\def\getline{%
+ \immediate\read\currentinput to \currentline \edef\currentline{\currentline}%
+ \setbox0\hbox{\expandafter\getkey\currentline::}}
+
+\def\fixnewoutputname{%
+ \expandafter\truncatekey\currentline\relax
+ \edef\outputname{\linecontents}%
+ \ifx\outputname\empty \edef\outputname{vicar.eps }%
+ \else \edef\outputname{\outputname.eps }\fi
+ \immediate\write16{extracting \outputname}}
+
+\def\optionallyopenout{%
+ \ifx\key\EPSfirstline
+ \optionallycloseout \fixnewoutputname
+ \immediate\openout\currentoutput\outputname\relax
+ \ifeof\currentoutput
+ \errmessage{CANNOT OPEN \outputname FOR WRITING}\global\outputopenfalse
+ \else
+ \global\outputopentrue
+ \fi
+ \fi}
+
+\def\optionallycloseout{\ifoutputopen \immediate\closeout\currentoutput \fi}
+
+\def\optionallyputline{%
+ \ifx\key\EPSline
+ \expandafter\truncatekey\currentline\relax
+ \immediate\write\currentoutput{\linecontents}%
+ \fi}
+
+\def\checklooping{\continuelooptrue\ifeof\currentinput\continueloopfalse\fi}
+
+\def\neutralizecatcodes{%
+ \catcode`\\12 \catcode`\%12 \catcode`\&12 \catcode`\_12
+ \catcode`\^12 \catcode`\{12 \catcode`\}12 \catcode`\/12 }
+
+\def\getlines{%
+ \begingroup
+ \endlinechar=-1
+ \neutralizecatcodes
+ \loop
+ \getline \ifx\prekey\empty \optionallyopenout \optionallyputline \fi
+ \checklooping \ifcontinueloop \repeat
+ \endgroup
+ \optionallycloseout}
+
+\getlines
+
+\end
diff --git a/graphics/MF-PS/progs/tex.bat b/graphics/MF-PS/progs/tex.bat
new file mode 100644
index 0000000000..58b4a5be5c
--- /dev/null
+++ b/graphics/MF-PS/progs/tex.bat
@@ -0,0 +1,8 @@
+::
+:: This file belongs to the MFTOEPS package.
+::
+@echo off
+::
+:: sample batch file calling TeX (see M2E-ALT.BAT)
+::
+tex386 /mt19000 /mf150000 &plain %1 %2 %3 %4 %5 %6 %7 %8 %9