summaryrefslogtreecommitdiff
path: root/graphics/mf2tex/mf2tex.mf
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/mf2tex/mf2tex.mf
Initial commit
Diffstat (limited to 'graphics/mf2tex/mf2tex.mf')
-rw-r--r--graphics/mf2tex/mf2tex.mf67
1 files changed, 67 insertions, 0 deletions
diff --git a/graphics/mf2tex/mf2tex.mf b/graphics/mf2tex/mf2tex.mf
new file mode 100644
index 0000000000..b93fd83cf1
--- /dev/null
+++ b/graphics/mf2tex/mf2tex.mf
@@ -0,0 +1,67 @@
+string fontname;
+
+def labelheader(expr name) =
+fontname=name;
+message "$#@!" & jobname; % for recognizing the file name
+message "!@#$\font\font" & fontname & "=" & jobname;
+message ""; % defining the fontname
+enddef;
+
+def labelfoot =
+message "!@#$";
+message "";
+enddef;
+
+def beginlabeledchar(expr a,b,c,d,name) =
+beginchar(a,b,c,d);
+message "!@#$";
+message "!@#$\def\" & fontname & name & "{\labels{%";
+enddef; % start of the character macro
+
+def endlabeledchar =
+message "!@#$}{\font" & fontname & " \char" & decimal charcode & "}}";
+message ""; % end of the character macro
+endchar;
+enddef;
+
+def label(expr x,y,hor,vert,co) =
+message "!@#$\move" & hor & vert & "(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef; % insert this text in these coordinates justified by parameters
+
+% abbreviations for all justifications
+def labelLU(expr x,y,co) =
+message "!@#$\moveLU(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelRU(expr x,y,co) =
+message "!@#$\moveRU(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelMU(expr x,y,co) =
+message "!@#$\moveMU(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelLD(expr x,y,co) =
+message "!@#$\moveLD(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelRD(expr x,y,co) =
+message "!@#$\moveRD(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelMD(expr x,y,co) =
+message "!@#$\moveMD(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelLM(expr x,y,co) =
+message "!@#$\moveLM(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelRM(expr x,y,co) =
+message "!@#$\moveRM(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelMM(expr x,y,co) =
+message "!@#$\moveMM(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelLB(expr x,y,co) =
+message "!@#$\moveLB(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelRB(expr x,y,co) =
+message "!@#$\moveRB(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;
+def labelMB(expr x,y,co) =
+message "!@#$\moveMB(" & decimal (x/cm) & "cm," & decimal (y/cm) & "cm,{" & co & "})%";
+enddef;