int stab
[] = {010,0,01,07,02,03,04,05,0211,06,0212,0213,0214,0215,0216,0217};
int rtab
[] = {6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 26, 18};
int ktab
[] = {';',';',';',';',';',';',':',':','9','9','9','9','8','8','8','9'};
extern int *drawtab
[], *moretab
[];
while((--argc
> 0) && ((++argv
)[0][0]=='-')){
if(fopen(argv
[0], ibuf
) < 0){
while((i
= getc(ibuf
)) >= 0){
xx
+= (esc
*mpy
+ rx
)/div
;
escd
= verd
= mcase
= railmag
= xx
= 0;
ohy
= oxb
= oly
= ohx
= olx
= -1;
case 0101: /*lower rail*/
case 0102: /*upper rail*/
case 0105: /*lower case*/
case 0106: /*upper case*/
case 0107: /*escape forward*/
case 0110: /*escape backward*/
case 0112: /*lead forward*/
case 0114: /*lead backward*/
if((i
& 0340) == 0140){ /*leading*/
if((leadtot
+= lead
) > pl
){
if((yy
-= (lead
<<1)) < 0){
if((i
& 0360) == 0120){ /*size change*/
for(j
= 0; i
!= (stab
[j
] & 017); j
++);
if(!(osize
& DBL
) && (size
& DBL
))i
= -55;
else if((osize
& DBL
) && !(size
& DBL
))i
= 55;
if(railmag
!= 03)j
= asctab
[i
];
if (j
== 0) { /* see if we can draw this character */
trace( railmag
== 03 ? drawtab
[i
] : moretab
[i
]);
# define SCL(x) (psize*x/10)
# define PT(x,y) xx-10+SCL(x), yy-20+SCL(y)
line(xx-10+SCL(p[1]),yy-20+SCL(p[2]),xx-10+SCL(p[3]),yy-20+SCL(p[4]));
*/ line(PT(p
[1], p
[2]), PT(p
[3], p
[4]));
circle(PT(p
[1],p
[2]), SCL(p
[3]));
arc (PT(p
[1],p
[2]), PT(p
[3],p
[4]), PT(p
[5],p
[6]));
int field
, digits
, *dd
, *tscale();
field
= digits
= acc
= 0;
while(((j
= (i
= getch()) - '0') >= 0) && (j
<= 9)){
if((field
!= digits
) && (digits
> 0)){
acc
= ldiv(dd
[1],dd
[0],j
);
case 'c': /*Centimeters; should be 170.0787*/
/* the way this program decides what to do is:
(1) If the character is on a standard font (0-2)
(a) look in "asctab"; if an entry, print that character.
(b) look in "moretab"; if an entry, it points to a vector
(2) If the character is on the special font (railmag=3)
(a) look in "spectab"; if an entry >0,
(b) if a -1, that requests the apl font; not used.
(c) if zero, look in "drawtab"; if an entry, it pooints
to a vector description, which draw.
(3) Vector descriptions are calls to the "plot" type routines.
the possible routines are 'c' (circle), 'l' (line), 't' (label,
only one character used), and 'a' (arc).
'-', /*some horizontal line*/
0, /*partial derivative*/
0, /*cap (intersection)*/
'|', /*right ceiling (rt of ")*/
'|', /*left top (of big curly)*/
'|', /*left center of big curly bracket*/
'|', /*right center of big curly bracket*/
'|', /*right floor (rb of ")*/
'|', /*left floor (left bot of big sq bract)*/
'|', /*left ceiling (lt of ")*/
'*', /*telephone asterisk?*/
int dnot
[] = { 'l', 0, 15, 25, 15, 'l', 25, 15, 25, 5, STOP
};
int dlambda
[] = {'l', 0, 40, 6, 40, 'l', 6, 40, 30, 0, 'l', 6, 0, 18, 20, STOP
};
int dSigma
[] = {'l', 0, 0, 30, 0, 'l', 0, 40, 30, 40, 'l', 0, 0, 10, 20, 'l', 10, 20, 0, 40, STOP
};
int dsquare
[] = {'l', 0, 0, 30, 0, 'l', 0, 0, 0, 30, 'l', 0, 30, 30, 30, 'l', 30, 0, 30, 30, STOP
};
int dDelta
[] = {'l', 0,0, 30, 0, 'l', 0, 0, 15, 40, 'l', 15,40, 30, 0, STOP
};
int dintsign
[] = { 'a', 25,30, 30,32, 20,32, 'l', 20, 32, 10, 8, 'a',5, 10, 0, 8, 10, 8, STOP
};
int dtheta
[] = {'a', 25, 15, 10, 30, 10, 0, 'a', -5, 15, 10, 0, 10, 30, 'l', 5, 15, 12, 15, STOP
};
int dcopyr
[] = {'c', 20, 20, 20, 't', 'c', 7,3, STOP
};
int dregist
[] = {'c', 20, 20, 20, 't', 'R', 7,3, STOP
};
int dpi
[] = { 'l', 0, 25, 30, 25, 'l', 5, 0, 8, 25, 'l', 17, 0, 20, 25, STOP
};
int dPi
[] = { 'l', 0, 40, 30, 40, 'l', 5, 0, 5, 40, 'l', 25, 0, 25, 40, STOP
};
int dsqroot
[] = { 'l', 0,10,5,10, 'l', 8, 10, 15, 0, 'l', 15, 0, 30, 40, STOP
};
int dgradient
[] = { 'l', 0,40, 30, 40, 'l', 0, 40, 15, 0, 'l', 15, 0, 30, 40, STOP
};
int dbeta
[] = {'t', 'B', 0, 5, 'l', 0, 20, 0, -10, STOP
};
int ddagger
[] = {'l', 0, 30, 20, 30, 'l', 10, 0, 10, 40, STOP
};
int dpsi
[] = { 'a', 15,25, 0, 27, 30, 23, 'l', 0, 0, 30, 40, STOP
};
int dmu
[] = { 't', 'u', 0,5, 'l', 0,10, 0, -10, STOP
};
int dnu
[] = { 'l',0,0,0,30, 'l', 0,0,20,30, STOP
};
int diota
[] = { 'l', 0, 0, 4, 24, 'l', 6, 32, 6, 36, 'l', 0, 0, 5, 0, STOP
};
int dsigma
[] = { 'c', 15,15,15, 'l', 15, 30, 35, 30, STOP
};
int ddelta
[] = { 'c', 10, 10, 10, 'a', 16, 28, 18, 37, 14, 19, STOP
};
int depsilon
[] = { 'a', 15, 15, 15, 30, 15, 0, 'l', 0, 15, 15, 15, STOP
};
int dchi
[] = { 'l', 0, 30, 4, 30, 'l', 4, 30, 16, 0, 'l', 16, 0, 20, 0, 'l', 0, 0, 20, 30, STOP
};
int dtau
[] = { 'l', 0, 30, 30, 30, 'l', 10, 0, 15, 30 , 'l', 10, 0, 15, 0, STOP
};
int dlesseq
[] = { 'l', 0, 20, 30, 30, 'l', 0, 20, 30, 10, 'l', 0, 15, 30, 5, STOP
};
int dgreateq
[] = { 'l', 0, 30, 30, 20, 'l', 0, 10, 30, 20, 'l', 0, 5, 30, 15, STOP
};
int dinfinity
[] = { 'c', 10, 10, 10, 'c', 30 , 10, 10, STOP
};
int dalpha
[] = { 'c', 15, 15, 15, 'a', 52, 15, 35, 30, 35, 0, STOP
};
int dphi
[] = { 'c', 10, 15, 10, 'l', 5, 0, 15, 30, STOP
};
int dgamma
[] = { 'l', 10, -10, 30, 30, 'a', 10, 15, 20, 10, 0, 20, STOP
};
int dkappa
[] = { 'l', 0, 0, 6, 25, 'l', 3, 12, 20, 25, 'l', 6, 15, 20, 0, STOP
};
int drho
[] = {'c', 15, 15, 10, 'l', 0, -5, 5, 20, STOP
};
int dGamma
[] = {'l', 0, 0, 0, 35, 'l', 0, 35, 25, 35, 'l', 25, 35, 25, 25, STOP
};
int ddownar
[]= {'l', 10, 0, 10, 30, 'l', 0, 10, 10, 0, 'l', 10, 0, 20, 10, STOP
};
int dupar
[] = { 'l', 10, 0, 10, 30, 'l', 0, 20, 10, 30, 'l', 10, 30, 20, 20,STOP
};
int dleftar
[] = { 'l', 0, 15, 25, 15, 'l', 10, 5, 0, 15, 'l', 10, 25, 0, 15, STOP
};
int drightar
[] = { 'l', 0, 15, 25, 15, 'l', 15, 5, 25, 15, 'l', 15, 25, 25, 15, STOP
};
int ddivide
[]= { 'l', 0, 15, 25, 15, 'l', 12, 20, 14, 20, 'l', 12, 10, 14, 10, STOP
};
int dcap
[] = { 'a', 15, 10, 30, 10, 0, 10, 'l', 0, 0, 0, 10, 'l', 30, 0, 30, 10, STOP
};
int dcup
[] = {'a', 15, 15, 0, 15, 30, 15, 'l', 0, 15, 0, 25, 'l', 30, 15, 30, 25, STOP
};
int dsubset
[] = {'l', 0, 0, 10, 0, 'l', 0, 30, 10, 30, 'a', 10, 15, 10, 0, 10, 30,STOP
};
int dsupset
[] = {'a', 15, 15, 15, 30, 15, 0, 'l', 15, 30, 25, 30, 'l', 15, 0, 25, 0, STOP
};
int dimpsubset
[] = {'l', 0, 10, 10, 10, 'l', 0, 40, 10, 40, 'a', 10, 25, 10, 10, 10, 40, 'l', 0, 0, 30, 0, STOP
};
int dimpsupset
[] = {'a', 15, 25, 15, 40, 15, 10, 'l', 15, 40, 25, 40, 'l', 15, 10, 25, 10, 'l', 0, 0, 30, 0, STOP
};
int dxi
[] = {'l', 0, 30, 25, 30, 'a', 5, 25, 5, 30, 5, 20, 'l', 5, 20, 25, 20, 'a', 5, 15, 5, 20, 5, 10, 'l', 5, 10, 20, 10, 'a', 20, 5, 20, 0, 20, 10, STOP
};
int deta
[] = {'a', 5,20,10,20,0,20, 'l', 10, 25, 10, 10, 'a', 15, 20, 20, 20, 10, 20, 'l', 20, 20, 20, 0, STOP
};
int dzeta
[] = {'l', 0, 30, 25, 30, 'a', 20, 20, 20, 30, 20, 10, 'a', 20, 5, 20, 0, 20, 10, STOP
};
int dPsi
[] = {'l', 0, 0, 30, 0, 'l', 0, 35, 30, 35, 'l', 15, 0, 15, 35, 'a', 15, 25, 0, 25, 30, 25, STOP
};
int dPhi
[] = { 'l', 0, 0, 30, 0, 'l', 0, 40, 30, 40, 'l', 15, 0, 15, 40, 'c', 15, 20, 10, STOP
};
int domega
[] = { 'a', 8, 18, 8, 26, 16, 18, 'a', 24, 18, 16, 18, 24, 26, STOP
};
int dtsigma
[] = {'a', 10, 20, 17, 27, 10, 10, 'a', 10, 5, 10, 0, 10, 10, STOP
};
int dpartial
[] = { 'c', 10, 10, 10, 'a', 0, 20, 10, 0, 0, 40, STOP
};
int dprop
[] = {'c', 10,10,10, 'a', 30, 10, 30, 20, 30, 0, STOP
};
int dTheta
[]= { 'c', 15, 15, 15, 'l', 5,15,25,15, 'l', 5, 13, 5, 17, 'l', 25, 13, 25, 17, STOP
};
int dXi
[] = { 'l', 0, 40 , 30, 40, 'l' , 0, 0, 30, 0, 'l', 7, 20, 23, 20, STOP
};
int dLambda
[] = { 'l', 0, 0, 15, 40, 'l', 15, 40, 30, 0, STOP
};
int drighth
[]= { 'l', 0,0,20,0, 'l', 0, 10, 20, 10, 'l',0,20,20,20, 'l',0,30,35,30, 'l',0,40,35,40,
'a',20,5,20,0,20,10, 'a', 20,15,20,10,20,20, 'a',20,25,20,20,20,30, 'a',35,35,35,30,35,30,STOP
};
int dlefth
[] = {'l', 20, 0, 40,0, 'l',20,10,40,10, 'l',20,20,40,20, 'l',5,30,40,30, 'l',5,40,40,40,
'a', 20, 5, 20,10,20,0, 'a', 20,15,20,20,20,10, 'a', 20, 25, 20,30,20,20, 'a', 5,35,5,40,5,30, STOP
};
int dcircle
[] = {'c',15,15,15,STOP
};
int dapprox
[] = {'a', 7, 0, 14, 15, 0, 15, 'a', 21, 30, 14,15,28,15, STOP
};
int dappreq
[] = {'a', 7, 0, 14, 15, 0, 15, 'a', 21, 30, 14,15,28,15, 'l', 0, 0, 28, 0, STOP
};
int dOmega
[] = {'a', 15,25,30,25,0,25, 'l',10,0,0,25, 'l',20,0,30,25, 'l',0,0,10,0, 'l',20,0,30,0, STOP
};
int dplmn
[] = {'l', 0, 0, 30, 0, 'l', 0, 25, 30, 25, 'l', 15,10, 15, 40, STOP
};
int dmultiply
[] = {'l',0,0,30,30, 'l', 0,30,30,0, STOP
};
int dident
[]= {'l', 0,0,30,0, 'l',0,10,30,10, 'l',0,20,30,20, STOP
};
int dnoteq
[] = {'l',0,10,30,10, 'l',0,25,30,25, 'l', 0,0,30,40, STOP
};
int ddbldag
[] = {'l',10,0,10,30, 'l',0,5,20,5, 'l',0,25,20,25, STOP
};
int dbullet
[] = { 'c',10,10,10, 'c',10,10,8, 'c', 10,10,6, 'c', 10, 10, 4, 'c', 10, 10, 2, STOP
};
int drooten
[] = {'l', 0,30,25,30, STOP
};
int dempty
[] = { 'c', 15, 15, 15, 'l', 0, 0, 30, 30, STOP
};
int dsection
[] = {'a', 7,7, 7, 0, 7, 14, 'c', 7,21, 7, 'a', 7, 35, 7, 42, 7, 28, STOP
};
int dff
[] = { 't', 'f', 0, 0, 't', 'f', 15, 0, STOP
};
int dfi
[] = { 't', 'f', 0, 0, 't', 'i', 15, 0, STOP
};
int dfl
[] = { 't', 'f', 0, 0, 't', 'l', 15, 0, STOP
};
int dffi
[] = { 't', 'f', 0, 0, 't', 'f', 15, 0, 't', 'i', 30, 0, STOP
};
int dffl
[] = { 't', 'f', 0, 0, 't', 'f', 15, 0, 't', 'l', 30, 0, STOP
};
int dcent
[] = {'a', 15, 20, 25, 17, 25, 13, 'l', 15, 0, 15, 35, STOP
};
int ddegree
[] = {'t', 'o', 0, 20, STOP
};
int dhalf
[] = {'t', '1', 0, 20, 'l', 0, 0, 30, 40, 't', '2', 15, 0, STOP
};
int dquarter
[] = {'t', '1', 0, 20, 'l', 0, 0, 30, 40, 't', '4', 15, 0, STOP
};
int dthreequarter
[] = {'t', '3', 0, 20, 'l', 0, 0, 30, 40, 't', '4', 15, 0, STOP
};
int dbell
[] = {'l', 0, 10, 40, 10, 'a', 0, 15, 0, 10, 5, 15, 'a', 40, 15, 35, 15, 40, 10,
'a', 20, 15, 35, 15, 15, 15, 'l', 20, 35, 20, 40, 'l', 20, 0, 20, 10, 'c', 20, 20, 22, STOP
};
dbell
, /*bell system sign*/
dimpsupset
, /*improper superset*/
dprop
, /*proportional to*/
dtsigma
, /*terminal sigma*/
0, /* some kind of horizontal line (ASCII) */
dintsign
, /*integral sign*/
dapprox
, /*approximates*/
dpartial
, /*partial derivative*/
dappreq
, /* approx equal */
dcap
, /*cap (intersection)*/
0, /*right ceiling (rt of ")*/
0, /*left top (of big curly)*/
0, /*left center of big curly bracket*/
0, /*right center of big curly bracket*/
0, /*right floor (rb of ")*/
0, /*left floor (left bot of big sq bract)*/
0, /*left ceiling (lt of ")*/
dident
, /*identically equal*/
0, /*' acute accent (ASCII)*/
0, /*` grave accent (ASCII)*/
dimpsubset
, /*improper subset*/
drightar
, /*right arrow*/
dsection
}; /*section mark*/
dquarter
, /* one quarter 1/4 */
dhalf
, /* one half 1/2 */
dthreequarter
, /* 3 /4 */
dregist
, /* registered */