%%
%% This is file `cicirc.mf',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% circ.dtx  (with options: `csycirc')
%% Copyright 1997-98  Sebastian Tannert / Andreas Tille
%% 
%% This file is part of the CIRC package
%% -------------------------------------
%%   This package is distributed in the hope that it will be useful,
%%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%%   For error reports concerning UNCHANGED versions of this file no
%%   more than one year old, see CIRC.DVI.
%% 
%% IMPORTANT COPYRIGHT NOTICE:
%% 
%% You are NOT ALLOWED to distribute this file alone.
%% 
%% You are allowed to distribute this file under the condition that it
%% is distributed together with all the files listed in circ.txt.
%% 
%% If you receive only some of these files from someone, complain!
%% 
%% You are NOT ALLOWED to change this file.
input csym;

designsize:=2lLE#;

fontdimen10: .4gat_ht#;
fontdimen11: .65gat_lt#;

fontdimen12: .5pin_lt#;
fontdimen13:  pin_spc#;
fontdimen14: .5ios_wd#+.5pin_lt#;
fontdimen15:  mid_wd#+ios_wd#;
fontdimen16:  ios_wd#;
fontdimen17:  out_spc#;


def defcircleabout(expr p, rad)=
  z[p]=.5[z[p+1],z[p+3]]=.5[z[p+2],z[p+4]];
  y[p+1]=y[p+3];
  x[p+2]=x[p+4];
  x[p]=lft(x[p+1])-rad;
  y[p]=top(y[p+4])+rad;
enddef;

def gate=
  charic:=.5pin_spc#;
  z0=(0,0);
  x20=x15=x1=x6=x7=  x0+pin_lt;
  y8=y6=-y7=         y0+.5gat_ht;
  x8=x9=x10=         x1+gat_lt-2pin_lt;
  y15=-y20=          y0+.5pin_spc;
  x25-x0=            gat_lt;

  y9=y7; y25=y10=y1=y0;
  x0=x26=x27;
  y26=y15; y27=y20;

  pickup pencircle scaled thickline;
  defcircleabout(1,inv_rad);
  defcircleabout(10,inv_rad);
  defcircleabout(15,inv_rad);
  defcircleabout(20,inv_rad);
enddef;

def segment =
  z0=(0,0);
  x1-x0=pin_lt; y0=y1;
  defcircleabout(1,inv_rad); % z2 z3 z4 z5 defined
  z1=.5[z6,z7]; x6=x7=x8;
  y7-y6=pin_spc;
  y8-y1=out_spc;
  x9-x8=ios_wd; y8=y9;
enddef;

def topbotsegs(expr fc, myht, mydp) =
  beginchar(fc+0,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z8--z9;
  endchar;
  beginchar(fc+1,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z8--z9;
    pickup pensquare scaled normalline;
    draw z0--z1;
  endchar;
  beginchar(fc+2,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z5;
    draw z3--z8--z9;
    pickup pencircle scaled normalline;
    draw fullcircle scaled 2inv_rad shifted z1;
    pickup pensquare scaled normalline;
    draw z0--z4;
  endchar;
  beginchar(fc+3,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z8--z9;
    pickup pensquare scaled normalline;
    draw z0--z1;
    pickup pencircle scaled normalline;
    draw z3--z2--z5;
  endchar;
enddef;

def midsegs(expr fc, myht, mydp) =
  beginchar(fc+0,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z8;
  endchar;
  beginchar(fc+1,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z8;
    pickup pensquare scaled normalline;
    draw z0--z1;
  endchar;
  beginchar(fc+2,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z5;
    draw z3--z8;
    pickup pencircle scaled thickline;
    draw fullcircle scaled 2inv_rad shifted z1;
    pickup pensquare scaled normalline;
    draw z0--z4;
  endchar;
  beginchar(fc+3,pin_lt#+ios_wd#,myht,mydp);
    pickup pensquare scaled thickline;
    segment
    draw z6--z8;
    pickup pensquare scaled normalline;
    draw z0--z1;
    pickup pencircle scaled normalline;
    draw z3--z2--z5;
  endchar;
enddef;

"obere Segmente Eing"&ditto&"ange";
topbotsegs(0,out_spc#,.5pin_spc#);

"obere Segmente Ausg"&ditto&"ange";
{{
  addTF(reflectedabout((.5(ios_wd+pin_lt),0),(.5(ios_wd+pin_lt),1)));
  topbotsegs(16,out_spc#,.5pin_spc#);
}}

"mittlere Segmente Eing"&ditto&"ange";
midsegs(32,.5pin_spc#,.5pin_spc#);

"mittlere Segmente Eing"&ditto&"ange";
{{
  addTF(reflectedabout((.5(ios_wd+pin_lt),0),(.5(ios_wd+pin_lt),1)));
  midsegs(48,.5pin_spc#,.5pin_spc#);
}}

"untere Segmente Eing"&ditto&"ange";
{{
  addTF(reflectedabout(left,right));
  topbotsegs(64,.5pin_spc#,out_spc#);
}}

"untere Segmente Ausg"&ditto&"ange";
{{
  addTF(reflectedabout(left,right));
  addTF(reflectedabout((.5(ios_wd+pin_lt),0),(.5(ios_wd+pin_lt),1)));
  topbotsegs(80,.5pin_spc#,out_spc#);
}}

"oberes Zwischensegment";
beginchar(96,mid_wd#,out_spc#,.5pin_spc#);
  pickup pensquare scaled thickline;
  draw (0,out_spc)--(mid_wd,out_spc);
endchar;

"Zwischensegment";
beginchar(97,mid_wd#,.5pin_spc#,.5pin_spc#);
endchar;

"unteres Zwischensegment";
beginchar(98,mid_wd#,.5pin_spc#,out_spc#);
  pickup pensquare scaled thickline;
  draw (0,-out_spc)--(mid_wd,-out_spc);
endchar;

"Gatter: Eingang, Ausgang";
beginchar(128,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z6--z8--z9--z7--cycle;
  pickup pensquare scaled normalline;
  draw z0--z1;
  draw z10--z25;
endchar;

"Gatter: Eingang negiert, Ausgang";
beginchar(129,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z3--z6--z8--z9--z7--z5;
  pickup pencircle scaled thickline;
  draw fullcircle scaled 2inv_rad shifted z1;
  pickup pensquare scaled normalline;
  draw z0--z4;
  draw z10--z25;
endchar;

"Gatter: Eingang, Ausgang negiert";
beginchar(130,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z14--z9--z7--z6--z8--z12;
  pickup pencircle scaled thickline;
  draw fullcircle scaled 2inv_rad shifted z10;
  pickup pensquare scaled normalline;
  draw z0--z1;
  draw z11--z25;
endchar;

"Gatter: zwei Eing"&ditto&"ange, Ausgang";
beginchar(131,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z6--z8--z9--z7--cycle;
  pickup pensquare scaled normalline;
  draw z15--z26;
  draw z20--z27;
  draw z10--z25;
endchar;

"Gatter: zwei Eing"&ditto&"ange, Ausgang negiert";
beginchar(132,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z14--z9--z7--z6--z8--z12;
  pickup pencircle scaled thickline;
  draw fullcircle scaled 2inv_rad shifted z10;
  pickup pensquare scaled normalline;
  draw z15--z26;
  draw z20--z27;
  draw z11--z25;
endchar;

"Gatter alt AND: zwei Eing"&ditto&"ange, Ausgang";
beginchar(133,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z1--z6{right}..z10{down}..{left}z7--cycle;
  pickup pensquare scaled normalline;
  draw z15--z26;
  draw z20--z27;
  draw z10--z25;
endchar;

"Gatter alt NAND: zwei Eing"&ditto&"ange, Ausgang";
beginchar(134,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z1--z6{right}..z10{down}..{left}z7--cycle;
  pickup pensquare scaled normalline;
  draw z15--z26;
  draw z20--z27;
  draw z10--z25;
  pickup pencircle scaled 2inv_rad;
  drawdot z10;
endchar;

"Gatter alt OR: zwei Eing"&ditto&"ange, Ausgang";
beginchar(135,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  z30=5[z26,z15];
  z31=5[z27,z20];
  z32= (z26--z30) intersectionpoint (z6{right}..{down}z10);
  z33= (z27--z31) intersectionpoint (z10{down}..{left}z7);
  pickup pensquare scaled thickline;
  draw z1--z6{right}..z10{down}..{left}z7--cycle;
  pickup pensquare scaled normalline;
  draw z26--z32;
  draw z27--z33;
  draw z10--z25;
endchar;

"Gatter alt NOR: zwei Eing"&ditto&"ange, Ausgang";
beginchar(136,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  z30=5[z26,z15];
  z31=5[z27,z20];
  z32= (z26--z30) intersectionpoint (z6{right}..{down}z10);
  z33= (z27--z31) intersectionpoint (z10{down}..{left}z7);
  pickup pensquare scaled thickline;
  draw z1--z6{right}..z10{down}..{left}z7--cycle;
  pickup pensquare scaled normalline;
  draw z26--z32;
  draw z27--z33;
  draw z10--z25;
  pickup pencircle scaled 2inv_rad;
  drawdot z10;
endchar;

"Gatter alt EQ: zwei Eing"&ditto&"ange, Ausgang";
beginchar(137,gat_lt#,.5gat_ht#,.5gat_ht#);
  gate;
  pickup pensquare scaled thickline;
  draw z1--z6{right}..z10{down}..{left}z7--cycle;
  pickup pensquare scaled normalline;
  draw z15--z26;
  draw z20--z27;
  draw z10--z25;
  x30=x31=x34=.2[x2,x13];
  y30=.7[y16,y2]; y30=y32;
  y31=.7[y21,y2]; y31=y33;
  x32=x33=x35=.8[x2,x13];
  y35=y34=y2;
  pickup pencircle scaled normalline;
  draw z30--z32;
  draw z31--z33;
  draw z34--z35;
endchar;

"box symbol empty";
beginchar(250,box_wd#,.5box_wd#,.5box_wd#);
  z0=(0,0);
  x0=x1=x2; x3=x4;
  y0=.5[y2,y1];
  y1=y3; y2=y4;
  y2-y1=x3-x1=box_wd;
  pickup pensquare scaled thickline;
  draw z1--z2--z4--z3--cycle;
endchar;

"box symbol cutted by line";
beginchar(251,box_wd#,.5box_wd#,.5box_wd#);
  z0=(0,0);
  x0=x1=x2; x3=x4;
  y0=.5[y2,y1];
  y1=y3; y2=y4;
  y2-y1=x3-x1=box_wd;
  pickup pensquare scaled thickline;
  draw z1--z2--z4--z3--cycle;
  pickup pencircle scaled normalline;
  draw z1--z4;
endchar;

"Black Box analog";
beginchar(252,bba_wd#,.5bba_ht#,.5bba_ht#);
  z0=(0,0); x1=x0=x2;
  z0=.5[z1,z2];
  y1-y2=y3-y4=bba_ht;  y1=y3;
  x3=x4=x0+bba_wd;
  pickup pensquare scaled thickline;
  draw z1--z2--z4--z3--cycle;
endchar;

"Black Box digital";
beginchar(253,bbd_wd#,.5bbd_ht#,.5bbd_ht#);
  z0=(0,0); x1=x0=x2;
  z0=.5[z1,z2];
  y1-y2=y3-y4=bbd_ht;  y1=y3;
  x3=x4=x0+bbd_wd;
  pickup pensquare scaled thickline;
  draw z1--z2--z4--z3--cycle;
endchar;

"OPV";
beginchar(254,opv_lt#,opv_ht#,opv_ht#);
  charic:=opv_dis#;
  numeric pl;
  pl:=pin_lt;
  z0=(0,0);
  z1=z0+(pl,opv_dis);
  z2=z0+(pl,opv_ht);
  z3=z0+(pl+opv_frc*2opv_ht,0);
  x4=x2; y4=-y2;
  x5=x1; y5=-y1;
  z6=z1-(pl,0);
  z7=z5-(pl,0);
  z8=z0+(opv_lt,0);
  z9=z5+(3pt,0);
  z10=z9+(4pt,0);
  z11=z1+(3pt,0);
  z12=z11+(4pt,0);
  z13=z11+(2pt,2pt);
  z14=z11+(2pt,-2pt);
  pickup pensquare scaled thickline;
  draw z2--z3--z4--cycle;
  pickup pensquare scaled normalline;
  draw z9--z10;
  draw z11--z12;
  draw z13--z14;
  draw z6--z1;
  draw z7--z5;
  draw z3--z8;
endchar;

"OPV";
beginchar(255,opv_lt#,opv_ht#,opv_ht#);
  charic:=opv_dis#;
  numeric pl;
  pl:=pin_lt;
  z0=(0,0);
  z1=z0+(pl,opv_dis);
  z2=z0+(pl,opv_ht);
  z3=z0+(pl+opv_frc*2opv_ht,0);
  x4=x2; y4=-y2;
  x5=x1; y5=-y1;
  z6=z1-(pl,0);
  z7=z5-(pl,0);
  z8=z0+(opv_lt,0);
  z9=z1+(3pt,0);
  z10=z9+(4pt,0);
  z11=z5+(3pt,0);
  z12=z11+(4pt,0);
  z13=z11+(2pt,2pt);
  z14=z11+(2pt,-2pt);
  pickup pensquare scaled thickline;
  draw z2--z3--z4--cycle;
  pickup pensquare scaled normalline;
  draw z9--z10;
  draw z11--z12;
  draw z13--z14;
  draw z6--z1;
  draw z7--z5;
  draw z3--z8;
endchar;

end;
%% 
%%
%% End of file `cicirc.mf'.
