summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tram/tram.mf
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tram/tram.mf')
-rwxr-xr-xmacros/latex/contrib/tram/tram.mf82
1 files changed, 82 insertions, 0 deletions
diff --git a/macros/latex/contrib/tram/tram.mf b/macros/latex/contrib/tram/tram.mf
new file mode 100755
index 0000000000..54d9de875d
--- /dev/null
+++ b/macros/latex/contrib/tram/tram.mf
@@ -0,0 +1,82 @@
+%%
+%% This is file `tram.mf',
+
+%%
+%% __________________________________
+%% Copyright © 2011–2013 Persian TeX Group
+%%
+%% License information appended.
+%%
+%%
+
+
+font_identifier:="tram";
+mode_setup;
+em#:=10pt#;
+fctrs [1] = 0.25;
+fctrs [2] = 0.30;
+fctrs [3] = 0.35;
+fctrs [4] = 0.40;
+fctrs [5] = 0.45;
+fctrs [6] = 0.50;
+fctrs [7] = 0.60;
+fctrs [8] = 0.75;
+bwd = 0.1;
+for i = 1 step 1 until 16:
+ penwd [i] = bwd;
+ bwd := bwd * 1.2;
+endfor;
+picture bpic,cpic;
+boolean badpen;
+ch:=0; cnt:=10;
+
+for peni = 1 step 1 until 16:
+ pen_x#:=penwd [peni] * pt#;
+ for fctri = 1 step 1 until 8:
+ wd#:=(1.5*1/(fctrs [fctri]))*pen_x#;
+ define_pixels(pen_x, wd);
+ badpen := false;
+ if pen_x < 1.0 : pen_x := 1.0; badpen := true; fi
+ cpic:=nullpicture;
+ fw := 5pt# / wd#; fw := round (fw + 0.5); if fw < 1 : fw := 1; fi;
+ fw := 2fw; % showvariable pen_x; showvariable fw; showvariable wd;
+ beginchar(ch,fw*wd#,fw*wd#,0);
+ x1:=0; x2:=x1; x3:=(1+.5wd); x4:=x3;
+ y1:=.5wd; y2:=(y1+wd); y3:=(y1-.5wd); y4:=(y3+wd);
+ if badpen or (wd < 2.99) :
+ x1 := x2 := 0.wd; y1 := y2 := 0.5wd;
+ fi;
+ fill fullcircle scaled pen_x shifted(z1);
+ fill fullcircle scaled pen_x shifted(z2);
+ if not badpen or (wd > 3) :
+ fill fullcircle scaled pen_x shifted(z3);
+ fill fullcircle scaled pen_x shifted(z4);
+ fi;
+ bpic:=currentpicture;
+ for i = 1 step 1 until fw - 1:
+ currentpicture:=currentpicture + bpic shifted (i*wd, 0);
+ endfor;
+ bpic:=currentpicture;
+ for i = 2 step 2 until fw - 1:
+ currentpicture:=currentpicture + bpic shifted (0, i*wd);
+ endfor;
+ endchar;
+ ch := ch + 1;
+ endfor; %%% fctri
+endfor; %%% peni
+end;
+%%
+%% Copyright © 2011–2013 by Persian TeX Group <persian-tex@tug.org>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status)
+%% by Persian TeX Group.
+%%
+%%
+%%
+%%
+%%
+%% End of file `tram.mf'.