| 1 |
%=== xslhd.mf ============================================================ |
| 2 |
% ick 96-08-24 modified to be "dashed" (each modification marked with WpH or ick ). |
| 3 |
% mods a la mods in xslhu.mf by WpH |
| 4 |
% ick 98-05-22 changed constants for gap, dash, pointendl, bluntendl |
| 5 |
% |
| 6 |
|
| 7 |
thick#:=1pt#; |
| 8 |
stepwidth#:=designsize/8; |
| 9 |
define_pixels(stepwidth); |
| 10 |
define_blacker_pixels(thick); |
| 11 |
picture save_pic; |
| 12 |
numheights:=16; |
| 13 |
numlengths:=8;%(12-96pt) |
| 14 |
gap:=thick; %was 1.5; WpH length of space between dashes. ick |
| 15 |
dash:=1.6thick; % 2.5; WpH length of each middle dash. ick |
| 16 |
pointendl:=-0.00dash; % -1.0; WpH length of first dash near point end. |
| 17 |
bluntendl:=-0.00thick; % -0.5; WpH length of last dash near blunt end. |
| 18 |
if unknown makedotted: makedotted:=0; fi % WpH |
| 19 |
path outerpath, innerpath; |
| 20 |
|
| 21 |
code=-1; |
| 22 |
for j=1 upto numlengths: |
| 23 |
slength#:=j*12pt#; |
| 24 |
define_pixels(slength); |
| 25 |
|
| 26 |
for i=1 upto numheights: |
| 27 |
beginchar(incr code, slength#, 0, 0); |
| 28 |
x1=y1=0;x2=slength;y2= i*stepwidth; |
| 29 |
end_angle:=min(2angle(z2-z1),90); |
| 30 |
penpos1(thick,90); |
| 31 |
penpos2(max(1,.15thick),min(2angle(z2-z1)+90,180)); |
| 32 |
outerpath:=z1r{dir(1)}..{dir(end_angle-1)}z2r; %ick |
| 33 |
innerpath:=z2l{dir(end_angle-180)}..z1l{left}; %ick |
| 34 |
fill outerpath--innerpath--cycle; %WpH created names for |
| 35 |
% outer and inner paths. |
| 36 |
% |
| 37 |
% WpH start of added block to make gaps. |
| 38 |
if makedotted<>1: |
| 39 |
% variable makedotted has not been given a value. |
| 40 |
% Dotted lines will not be made. |
| 41 |
else: |
| 42 |
cullit; |
| 43 |
mw:=abs(x2,y2); %approximate length of curve. |
| 44 |
tcount:=(mw-pointendl-bluntendl)/(gap+dash); % number of gaps. |
| 45 |
tcount:=floor(tcount + .5); %round to nearest int number. |
| 46 |
tinc:=((mw-pointendl-bluntendl)/tcount)/mw; |
| 47 |
pickup pencircle scaled gap; |
| 48 |
for k=0 upto tcount-1: |
| 49 |
t:= (pointendl + .5gap)/mw + k*tinc; |
| 50 |
undraw (point t of outerpath).. |
| 51 |
(point (1-t) of innerpath); % for "90 degree" dash edges. |
| 52 |
% undraw ((point t of outerpath)+(0,1.5pt)).. |
| 53 |
% ((point t of outerpath)-(0,1.5pt)); % for vertical edges. |
| 54 |
endfor; |
| 55 |
cullit; |
| 56 |
fi |
| 57 |
% WpH end of added block to make gaps. |
| 58 |
% |
| 59 |
save_pic:=currentpicture; |
| 60 |
endchar; |
| 61 |
|
| 62 |
beginchar(128+code, slength#, 0, 0); |
| 63 |
currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1)); |
| 64 |
endchar; |
| 65 |
endfor |
| 66 |
|
| 67 |
endfor |
| 68 |
end |
| 69 |
|