summaryrefslogtreecommitdiff
path: root/fonts/musixtex-fonts/source/xslhu.mf
blob: 7c7ff1d524e857402c5d0bc1b735d1db31ab2d31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%=== xslhu.mf ============================================================
% WpH  6-19-96 modified to be "dashed" (each modification marked with WpH).
%     96-08-24 constants fixed (ick)
% ick 98-05-22 changed constants for gap, dash, pointendl, bluntendl
%
     
thick#:=1pt#;
stepwidth#:=designsize/8;
define_pixels(stepwidth);
define_blacker_pixels(thick);
picture save_pic;
numheights:=16;
numlengths:=8;%(12-96pt)
gap:=thick;		%was 1.5; WpH length of space between dashes. ick
dash:=1.6thick;		%    2.5; WpH length of each middle dash.     ick
pointendl:=-0.00dash;	%   -1.0; WpH length of first dash near point end.
bluntendl:=-0.00thick;	%   -0.5; WpH length of last dash near blunt end. 
if unknown makedotted: makedotted:=0; fi % WpH
path outerpath, innerpath;

code=-1;
for j=1 upto numlengths:
  slength#:=j*12pt#;
  define_pixels(slength);
     
  for i=1 upto numheights:
    beginchar(incr code, slength#, 0, 0);
      x1=y1=0;x2=slength;y2=-i*stepwidth;
      end_angle:=max(2angle(z2-z1),-90);
      penpos1(thick,90);
      penpos2(max(1,.15thick),end_angle+90); 
      outerpath:=z1r{dir(1)}..{dir(end_angle-1)}z2r;  %WpH
      innerpath:=z2l{dir(end_angle+180)}..z1l{left}; %WpH
      fill outerpath--innerpath--cycle; %WpH created names for 
                                        %    outer and inner paths.
      %
      % 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;
          mw:=abs(x2,y2); %approximate length of curve.
          tcount:=(mw-pointendl-bluntendl)/(gap+dash); % number of gaps.
          tcount:=floor(tcount + .5); %round to nearest int number.
          tinc:=((mw-pointendl-bluntendl)/tcount)/mw;
          pickup pencircle scaled gap;
          for k=0 upto tcount-1:
              t:= (pointendl + .5gap)/mw + k*tinc;
              undraw (point t of outerpath)..
                     (point (1-t) of innerpath); % for "90 degree" dash edges.
%             undraw ((point t of outerpath)+(0,1.5pt))..
%                    ((point t of outerpath)-(0,1.5pt)); % for vertical edges.
          endfor;
          cullit;
      fi
      % WpH end of added block to make gaps.
      %
      save_pic:=currentpicture;
    endchar;
     
    beginchar(128+code, slength#, 0, 0);
      currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1));
    endchar;
  endfor
     
endfor
end