summaryrefslogtreecommitdiff
path: root/fonts/logic
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 /fonts/logic
Initial commit
Diffstat (limited to 'fonts/logic')
-rw-r--r--fonts/logic/milstd.mf438
-rw-r--r--fonts/logic/milstd.sty9
-rw-r--r--fonts/logic/milstd.tex32
3 files changed, 479 insertions, 0 deletions
diff --git a/fonts/logic/milstd.mf b/fonts/logic/milstd.mf
new file mode 100644
index 0000000000..3830750d5b
--- /dev/null
+++ b/fonts/logic/milstd.mf
@@ -0,0 +1,438 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% "milstd" font by Rick Simpson
+% (published in UKTeX 1988, issue 30 (23 Sept. 1988))
+
+% Contains a collection of special characters for
+% use in logic diagrams
+
+
+% To create the "milstd" font, use command:
+% makefont milstd
+
+% To use the characters in a PLAIN TeX document:
+% \font\milstd=milstd % define the font
+% . . .
+% {\milstd\char0} % typeset the character
+
+% To use the characters in a LaTeX document:
+% \newfont{\milstd}{milstd} % define the font
+% . . .
+% {\milstd\char0} % typeset the character
+
+% See "milstd.tex" for definitions to be used with TeX and LaTeX
+
+
+mode_setup;
+font_size 10pt#;
+
+picture pic;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Slanting line at 45-degree angle for marking
+% busses in logic diagrams.
+
+slwd#:=7pt#;
+define_pixels(slwd);
+
+beginchar(0,slwd#,slwd#,0); "Slanted line for buss widths";
+
+x1 = 0;
+y1 = 0;
+
+x2 = slwd;
+y2 = slwd;
+
+pickup pencircle scaled 1pt;
+draw z1--z2;
+
+labels (range 1 thru 2);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% AND gate, facing to the right
+%
+
+gateunit# := 6pt#;
+
+gatea# := 2 * gateunit#;
+gateb# := 4 * gateunit#;
+gatec# := 2.5 * gateunit#;
+gated# := 2 * gateunit#;
+
+define_pixels(gatea,gateb,gatec,gated);
+
+beginchar(1,gatec#+gated#,gateb#,0); "AND gate, right";
+
+x1 = x2 = 0;
+x3 = x5 = gatec;
+x4 = gatec + gated;
+
+y1 = y5 = 0;
+y2 = y3 = gateb;
+y4 = gatea;
+
+pickup pencircle scaled 1pt;
+draw z1--z2--z3{right}..z4..{left}z5--z1;
+
+pic := currentpicture;
+
+labels (range 1 thru 5);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% AND gate, facing down
+%
+
+beginchar(2,gateb#,gatec#+gated#,0); "AND gate, down";
+
+currentpicture := pic rotated 270 shifted (0,gatec+gated);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% AND gate, facing to the left
+%
+
+beginchar(3,gatec#+gated#,gateb#,0); "AND gate, right";
+
+currentpicture := pic rotated 180 shifted(gatec+gated,gateb);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% AND gate, facing up
+%
+
+beginchar(4,gateb#,gatec#+gated#,0); "AND gate, up";
+
+currentpicture := pic rotated 90 shifted(gateb,0);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NAND gate, facing to the right
+%
+
+gatee# := gateunit#;
+
+define_pixels(gatee);
+
+beginchar(5,gatec#+gated#,gateb#,0); "NAND gate, right";
+
+x1 = x2 = 0;
+x3 = x5 = gatec;
+x4 = gatec + gated;
+x6 = x4 + gatee/2;
+
+y1 = y5 = 0;
+y2 = y3 = gateb;
+y4 = gatea;
+y6 = y4;
+
+pickup pencircle scaled 1pt;
+draw z1--z2--z3{right}..z4..{left}z5--z1;
+draw fullcircle scaled gatee shifted(z6);
+
+pic := currentpicture;
+
+labels (range 1 thru 6);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NAND gate, facing down
+%
+
+beginchar(6,gateb#,gatec#+gated#,0); "NAND gate, down";
+
+currentpicture := pic rotated 270 shifted (0,gatec+gated);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NAND gate, facing to the left
+%
+
+beginchar(7,gatec#+gated#,gateb#,0); "NAND gate, right";
+
+currentpicture := pic rotated 180 shifted(gatec+gated,gateb);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NAND gate, facing up
+%
+
+beginchar(8,gateb#,gatec#+gated#,0); "NAND gate, up";
+
+currentpicture := pic rotated 90 shifted(gateb,0);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% OR gate, facing to the right
+%
+
+gatef# := .75 * gateunit#;
+gateg# := 1.5 * gateunit#;
+gateh# := 3 * gateunit#;
+
+define_pixels(gatef,gateg,gateh);
+
+beginchar(9,gateg#+gateh#,gateb#,0); "OR gate, right";
+
+x1 = x2 = 0;
+x3 = x5 = gateg;
+x4 = gateg + gateh;
+x6 = gatef;
+
+y1 = y5 = 0;
+y2 = y3 = gateb;
+y4 = y6 = gatea;
+
+pickup pencircle scaled 1pt;
+draw z1..z6..z2;
+draw z2--z3;
+draw z3{right}..{(1,-2)}z4;
+draw z4{-1,-2}..z5{left};
+draw z5--z1;
+
+pic := currentpicture;
+
+labels (range 1 thru 6);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% OR gate, facing down
+%
+
+beginchar(10,gateb#,gateg#+gateh#,0); "OR gate, down";
+
+currentpicture := pic rotated 270 shifted (0,gateg+gateh);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% OR gate, facing to the left
+%
+
+beginchar(11,gateg#+gateh#,gateb#,0); "OR gate, left";
+
+currentpicture := pic rotated 180 shifted(gateg+gateh,gateb);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% OR gate, facing up
+%
+
+beginchar(12,gateb#,gateg#+gateh#,0); "OR gate, up";
+
+currentpicture := pic rotated 90 shifted(gateb,0);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NOR gate, facing to the right
+%
+
+beginchar(13,gateg#+gateh#,gateb#,0); "NOR gate, right";
+
+x1 = x2 = 0;
+x3 = x5 = gateg;
+x4 = gateg + gateh;
+x6 = gatef;
+x7 = x4 + gatee/2;
+
+y1 = y5 = 0;
+y2 = y3 = gateb;
+y4 = y6 = gatea;
+y7 = y4;
+
+pickup pencircle scaled 1pt;
+draw z1..z6..z2;
+draw z2--z3;
+draw z3{right}..{(1,-2)}z4;
+draw z4{-1,-2}..z5{left};
+draw z5--z1;
+draw fullcircle scaled gatee shifted (z7);
+
+pic := currentpicture;
+
+labels (range 1 thru 7);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NOR gate, facing down
+%
+
+beginchar(14,gateb#,gateg#+gateh#,0); "NOR gate, down";
+
+currentpicture := pic rotated 270 shifted (0,gateg+gateh);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NOR gate, facing to the left
+%
+
+beginchar(15,gateg#+gateh#,gateb#,0); "NOR gate, left";
+
+currentpicture := pic rotated 180 shifted(gateg+gateh,gateb);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% NOR gate, facing up
+%
+
+beginchar(16,gateb#,gateg#+gateh#,0); "NOR gate, up";
+
+currentpicture := pic rotated 90 shifted(gateb,0);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Buffer, facing to the right
+%
+
+gatei# := 3 * gateunit#;
+gatej# := .866 * gatei#;
+gatek# := 1.5 * gateunit#;
+
+define_pixels(gatei,gatej,gatek);
+
+beginchar(17,gatej#,gatei#,0); "Buffer, right";
+
+x1 = x2 = 0;
+x3 = gatej;
+
+y1 = 0;
+y2 = gatei;
+y3 = gatek;
+
+pickup pencircle scaled 1pt;
+draw z1--z2--z3--z1;
+
+pic := currentpicture;
+
+labels (range 1 thru 3);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Buffer, facing down
+%
+
+beginchar(18,gatei#,gatej#,0); "Buffer, down";
+
+currentpicture := pic rotated 270 shifted (0,gatej);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Buffer, facing to the left
+%
+
+beginchar(19,gatej#,gatei#,0); "Buffer, left";
+
+currentpicture := pic rotated 180 shifted(gatej,gatei);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Buffer, facing up
+%
+
+beginchar(20,gatei#,gatej#,0); "Buffer, up";
+
+currentpicture := pic rotated 90 shifted(gatei,0);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Inverter, facing to the right
+%
+
+beginchar(21,gatej#,gatei#,0); "Inverter, right";
+
+x1 = x2 = 0;
+x3 = gatej;
+x4 = x3 + gatee/2;
+
+y1 = 0;
+y2 = gatei;
+y3 = y4 = gatek;
+
+
+pickup pencircle scaled 1pt;
+draw z1--z2--z3--z1;
+draw fullcircle scaled gatee shifted (z4);
+
+pic := currentpicture;
+
+labels (range 1 thru 4);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Inverter, facing down
+%
+
+beginchar(22,gatei#,gatej#,0); "Inverter, down";
+
+currentpicture := pic rotated 270 shifted (0,gatej);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Inverter, facing to the left
+%
+
+beginchar(23,gatej#,gatei#,0); "Inverter, left";
+
+currentpicture := pic rotated 180 shifted(gatej,gatei);
+
+endchar;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Inverter, facing up
+%
+
+beginchar(24,gatei#,gatej#,0); "Inverter, up";
+
+currentpicture := pic rotated 90 shifted(gatei,0);
+
+endchar;
+
+end;
diff --git a/fonts/logic/milstd.sty b/fonts/logic/milstd.sty
new file mode 100644
index 0000000000..451f726faa
--- /dev/null
+++ b/fonts/logic/milstd.sty
@@ -0,0 +1,9 @@
+% a jiffy package for using milstd.tex via \usepackage
+%
+% this file written for tidiness sake, only ...
+% by Robin Fairbairns
+
+\ProvidesPackage{milstd}[2009/06/25 v1.0a jiffy for loading milstd macros]
+
+\input{milstd}
+\endinput
diff --git a/fonts/logic/milstd.tex b/fonts/logic/milstd.tex
new file mode 100644
index 0000000000..06e740fb61
--- /dev/null
+++ b/fonts/logic/milstd.tex
@@ -0,0 +1,32 @@
+%-------------------------------cut here----------------------------------
+% milstd.tex
+%
+% Special characters for logic diagrams (as in MIL-STD 806)
+%
+\newfont{\milstd}{milstd}
+%
+\def\BusWidth{{\milstd\char0}} % '/' for bus width notation
+\def\ANDr{{\milstd\char1}} % AND gate facing right
+\def\ANDd{{\milstd\char2}} % down
+\def\ANDl{{\milstd\char3}} % left
+\def\ANDu{{\milstd\char4}} % up
+\def\NANDr{{\milstd\char5}} % NAND gate facing right
+\def\NANDd{{\milstd\char6}}
+\def\NANDl{{\milstd\char7}}
+\def\NANDu{{\milstd\char8}}
+\def\ORr{{\milstd\char9}} % OR gate facing right
+\def\ORd{{\milstd\char10}}
+\def\ORl{{\milstd\char11}}
+\def\ORu{{\milstd\char12}}
+\def\NORr{{\milstd\char13}} % NOR gate facing right
+\def\NORd{{\milstd\char14}}
+\def\NORl{{\milstd\char15}}
+\def\NORu{{\milstd\char16}}
+\def\BUFr{{\milstd\char17}} % Buffer facing right
+\def\BUFd{{\milstd\char18}}
+\def\BUFl{{\milstd\char19}}
+\def\BUFu{{\milstd\char20}}
+\def\INVr{{\milstd\char21}} % Inverter facing right
+\def\INVd{{\milstd\char22}}
+\def\INVl{{\milstd\char23}}
+\def\INVu{{\milstd\char24}}