%%\medskip
screenstrokes;
show mode;
%%$>>$ mode
mode_setup; show mode;
%%$>>$ 1

%%Initially, mode doesn't have a value although it has been declared
%%numeric. When {\tt mode\_setup} is run, if {\tt mode} doesn't have a
%%value, 
%%it is set to {\tt proof} mode.

show mode_name[mode]; %proof\_
drawdot origin; showit;
numeric mode; mode=CanonCX; mode_setup;
drawdot origin+(50,50); showit; show pt; %4.1511

numeric mode; mode=proof; mode_setup; 
drawdot origin+(50,50); showit; show pt; %36

%%When {\tt mode\_setup} is called, among other things, it sets the
%%device dependent values of the various units. In other words, units
%%like {\tt mm} or {\tt in} are just numerics which give the number of 
%%pixels in that unit for the currently defined device (i.e., mode).
%%The default pen is  .4pt in diameter; thus, in proof mode, a dot is
%%$round(36*.4)=14$ pixels 
%%wide. CanonCX is for 300dpi LaserJets, etc. 
%%where the corresponding dot
%%is only $round(4.1511*.4)=2$ pixels wide. To reset {\tt mode,} clear
%%the previous equation by declaring {\tt mode} as {\tt numeric.} 
%%
%%To see the names of the various modes, one can do: 

for i=1 upto number_of_modes:
 message "mode "&decimal i&" is "&mode_name[i]; 
endfor;

%%Lets look at some pens:

string s; 
for i=10 step -1.5 until 1:
 a:=300/i; %want pens about the same size
 pickup pencircle scaled i; pickup currentpen scaled a;
 drawdot (200,100); 
 undraw (200,100); 
endfor;
%%\font\dotsetc=dotsetcp 
%%\bigskip\centerline{\dotsetc A\hfil B}
%%\bigskip\centerline{\dotsetc C\hfil D}
%%\bigskip\centerline{\dotsetc E\hfil F}
%%\bigskip\centerline{\dotsetc G\hfil H}
%%\bigskip\centerline{\dotsetc I\hfil J}
%%\bigskip\centerline{\dotsetc K\hfil L}
%%\bigskip\centerline{\dotsetc M\hfil N}\bigskip

%%We want to look at small pens; thus we first create the pen to define
%%its shape and then magnify it. As you can see, \mf's pencirle isn't
%%really a circle, but rather a polygonal approximation to one. When one
%%is outputing to a particular discrete device, the resulting rounding
%%errors are reduced by using such convex polygons. Any convex polygon
%%can be used as a pen (and vice-versa); \mf's plain format predefines
%%{\tt penrazor, pensquare, pencircle} which can be scaled in {\tt x,y}
%% directions 
%%separately.  Also notice that {\tt drawdot (x,y)} and {\tt draw (x,y)}
%%aren't exactly the same; again, discretization errors make it useful
%%to have a special routine to draw dots. This careful attention to
%%problems of discretization is one of the three main differences
%%between \mf\ and Postscript. 
%%
end
