% WpH May, 19, 1997 modified to be dashed.
%
%

min_bow:= internote;
max_bow:=3internote;
slope:=17.5/100;
gap:=thick;                  %Wph length of space between dashes.
dash:=1.6thick;              %Wph Length of each rising or falling dash.
pointendl:=dash;             %WpH length of first and last dash.
centerdashl:=-dash;          %WpH length of center dash.
if unknown makedotted: makedotted:=0; fi % WpH
path outerpath, innerpath;   %Wph declaration of path variables.

code=-1;

for iht=1 upto 8:
  for iwd=0 upto 15:
    beginchar(incr code, 0, 0, 0);
      mw#:=(minwidth+iwd*delwidth)*pt#;
      define_pixels(mw);
      x1 = y1= 0; x3= mw; y3= 2y2'= iht*internote; x2'= .5x3;
      mheight:=y3;
      z2-z2'= whatever*dir(angle(z3-z1)+90);
      my_bow:=min(max_bow, slope*mw);
      my_bow:=max(my_bow, min_bow);
      z1'=(z1-(0,my_bow)) rotated angle(z3-z1);
      (z1'-z2)=whatever*(z1-z2');
      penpos1(.15thick,(angle(z3-z1)+90));
      penpos2(thick,(angle(z3-z1)+90));
      penpos3(.15thick,(angle(z3-z1)+90));
      penstroke (flex(z1e,z2e,z3e));  
%{{{
      currentpen:= pencircle;
      draw (flex(z1,z2,z3));% draw z1--z3; draw z2'--z2--z1'--z1;
%}}}
      %
      % WpH start of added block to make gaps.
    if makedotted<>1: 
        % variable makedotted has not been given a value.
        % Dotted lines will not be made.
    else:
          cullit;
          outerpath:= flex(z1r,z2r,z3r);    
          innerpath:= flex(z1l,z2l,z3l);    
          cl:=abs(z2-z1); %apporximate curve length/2
          tcount:=(cl-pointendl-0.5centerdashl)/(gap+dash); % number of gaps on rise or fall.
          tcount:=floor(tcount + .5); %round to nearest int number
          tinc:=((cl-pointendl-.5centerdashl)/tcount); 
          pickup pencircle scaled gap;
          for k=0 upto tcount-1:
            tt:=((pointendl + .5gap) + k*tinc)/(cl);
            undraw (point tt of outerpath)..(point tt of innerpath);
            undraw (point (2-tt) of outerpath)..(point (2-tt) of innerpath);
%
%              I expected the undraw statements to be the following. If the 
%              other code fails on your version of metafont, try this:
%
%               undraw (point .5tt of outerpath)..(point .5tt of innerpath);
%               undraw (point (1-.5tt) of outerpath)..(point (1-.5tt) of innerpath);
%   
          endfor;
          cullit;
      fi
      % Wph End of added block to make gaps.
      %
      currentpicture:=currentpicture t;
      p:=currentpicture;
    endchar;

    beginchar(code+128, 0, 0, 0);
      currentpicture:=p T;
    endchar;

  endfor
endfor
end
