1: /* fed.h 4.1 83/03/09 */
2: /*
3: * fed.h: global definitions for font editor.
4: */
5:
6: #include <stdio.h>
7: #include <ctype.h>
8: #include <vfont.h>
9: #include <signal.h>
10: #include <setjmp.h>
11:
12: /* current windows - what's on the screen */
13:
14: #define SCRHI 360 /* number of pixels on the screen */
15: #define SCRWID 720 /* width in pixels of the screen */
16: #define NROW 3 /* number of rows of glyphs on the screen */
17: #define NCOL 7 /* number of cols of glyphs in a row */
18: #define NWIND (NROW*NCOL) /* number of windows */
19: #define GLCOL 100 /* width of a glyph window */
20: #define GLROW 100 /* height of a glyph window */
21: #define GLPAD 3 /* number of pixels between windows */
22: #define WINDSIZE (((GLCOL+7)>>3)*GLROW) /* size in bytes of a window */
23: #define BASELINE 22 /* number of pixels below baseline in window */
24: #define SLOPE (3.5) /* Amount to slant italic vertical line */
25: /* equal to about 15.94 degrees */
26: /* for 5 degree caligraphy slant use 11.43 */
27:
28: #define ESC '\033' /* The ASCII escape character */
29:
30: #define abs(x) ((x) < 0 ? (-(x)) : (x))
31: #define max(x,y) ((x) > (y) ? (x) : (y))
32: #define min(x,y) ((x) < (y) ? (x) : (y))
33:
34: typedef char *bitmat;
35:
36: int changes; /* nonzero if changes since last write */
37: char curchar; /* current character being edited */
38: int curcurs; /* 1 if cursor is on now */
39: int currb; /* 1 if rubber band lie is on now */
40: int curs_r, curs_c; /* position in current window of graphics cursor */
41: int curwind; /* current open window number */
42: int curzoom; /* 1 to 9 - current zoom level of screen */
43: int editing; /* in file I/O command, true if editing font */
44: jmp_buf env;
45: long fbase; /* first loc in font file of bits */
46: FILE * fontdes; /* open for reading, current font */
47: char fontfile[100]; /* name of the font file */
48: int hpensize; /* size of heavy pen in pixels diameter of dot */
49: char msgbuf[100]; /* scratch space to sprintf into for messages */
50: int nextwind; /* the next free window to grab */
51: int oldzoom; /* the value of curzoom before a message */
52: int pen_r, pen_c; /* row/col in current glyph of logical pen */
53: int pencolor; /* 0=erase, 1=draw */
54: int penweight; /* 0=fine, 1=heavy */
55: int pointsize; /* point size of current font */
56: int QUIET; /* true if -q flag */
57: char stoutbuf[BUFSIZ]; /* for speed */
58: FILE *trace; /* for debugging output */
59: char tracebuf[BUFSIZ]; /* for speed */
60: int und_p_r, und_p_c; /* pen_r, pen_c for undo */
61: int und_c_r, und_c_c; /* curs_r, curs_c for undo */
62:
63: struct header ;
64: struct dispatch disptable[256];
65:
66: struct cwind {
67: bitmat val; /* what we are making it into */
68: bitmat onscreen; /* what's currently on the screen */
69: bitmat undval; /* the previous version */
70: char used; /* the character using this window */
71: } wind[NROW * NCOL];
72:
73: struct cht {
74: int wherewind; /* >=0: window # on screen, -1: in file, -2: use whereat */
75: bitmat whereat; /* where it can be found */
76: int nrow, ncol; /* size of char */
77: int rcent, ccent; /* bit location of lower left corner of main part of char */
78: } cht[256];
79:
80: struct place {
81: int c, r;
82: } base[NROW * NCOL]; /* lower left corner of each window */
83:
84: char penmat[10][10]; /* 0 or 1 as the pen is. 5,5 is center */
85: float sqrtmat[10][10]; /* table of sqrt(i**2+j**2) for speed */
86:
87: char *rdchar();
88: char esccmd();
89: bitmat newmat();
90: bitmat findbits();
91: int onsig();
92: int onintr();
93: float sqrt();
94:
95: int matcnt[10];
Defined variables
defined in line
63; used 12 times
QUIET
defined in line
56; used 1 times
base
defined in line
82; used 32 times
cht
defined in line
78; used 69 times
- in /usr/src/old/fed/fed.c line
75-76(2),
228-229(2)
- in /usr/src/old/fed/io.c line
31-35(3),
81-82(2),
108-111(3),
171-173(2),
211,
217-220(3),
230-235(6),
337-338(2),
348-358(8),
402
- in /usr/src/old/fed/subr.c line
230-239(4),
255(2),
265-269(4),
515-520(5),
528-535(6),
542,
600-604(2),
682-683(2),
700-702(3),
936,
969-970(2),
1003-1004(2)
curchar
defined in line
37; used 53 times
- in /usr/src/old/fed/fed.c line
75-76(2),
117-120(3),
228-229(2)
- in /usr/src/old/fed/io.c line
29-35(4),
72,
92,
99-111(11),
345-346(4)
- in /usr/src/old/fed/subr.c line
273(2),
637-646(6),
664,
673,
682-683(2),
700-702(3),
890,
936,
969-970(2),
989(2),
1003-1004(2),
1023(2)
currb
defined in line
39; used 3 times
curs_c
defined in line
40; used 21 times
- in /usr/src/old/fed/fed.c line
76,
92-95(2),
104-107(3),
126-129(2),
156-159(2),
166-168(2),
229,
266,
320
- in /usr/src/old/fed/io.c line
107-109(2)
- in /usr/src/old/fed/subr.c line
307,
327,
702,
796
curs_r
defined in line
40; used 21 times
- in /usr/src/old/fed/fed.c line
75,
92-95(2),
104-107(3),
136-139(2),
146-149(2),
166-168(2),
228,
266,
320
- in /usr/src/old/fed/io.c line
107-108(2)
- in /usr/src/old/fed/subr.c line
307,
327,
701,
797
curwind
defined in line
41; used 61 times
- in /usr/src/old/fed/fed.c line
96,
105-109(2),
168(2),
263-264(2),
320-322(2)
- in /usr/src/old/fed/io.c line
37-41(4),
64-67(3),
110
- in /usr/src/old/fed/subr.c line
20,
205-206(3),
301-305(5),
319-328(8),
376-381(2),
532-533(2),
552,
667-668(3),
699,
796-797(2),
816-819(2),
909,
926-927(2),
941-953(6),
974,
1008,
1039,
1113,
1147
disptable
defined in line
64; used 88 times
- in /usr/src/old/fed/io.c line
21,
99-106(7),
168-176(6),
187(2),
213-214(2),
230-236(8),
311,
336-346(9),
360,
403-409(7)
- in /usr/src/old/fed/subr.c line
72,
79-84(4),
129-135(5),
177(4),
228,
254-261(5),
514(2),
541(2),
605-611(7),
643,
741-748(8),
989(2),
1023(2)
env
defined in line
44; used 4 times
fbase
defined in line
45; used 4 times
msgbuf
defined in line
49; used 71 times
- in /usr/src/old/fed/fed.c line
118-119(2),
333-334(2),
377-378(2)
- in /usr/src/old/fed/io.c line
24-25(2),
72-73(2),
152-164(7),
191-192(2),
297-299(2),
320-321(2),
362-365(2),
384-385(2),
465-470(4)
- in /usr/src/old/fed/subr.c line
64-65(2),
202-203(2),
418-419(2),
503-511(6),
591-596(4),
638-639(2),
646-647(2),
673-674(2),
735-736(2),
754-755(2),
855-856(2),
867-885(12)
pen_c
defined in line
52; used 6 times
pen_r
defined in line
52; used 6 times
wind
defined in line
71; used 65 times
- in /usr/src/old/fed/fed.c line
105,
263,
320
- in /usr/src/old/fed/io.c line
76-92(11),
107,
220,
350
- in /usr/src/old/fed/subr.c line
197-202(3),
266,
303-305(4),
319-324(5),
376-381(2),
517,
529,
601,
664,
677-690(9),
697,
705,
816-819(2),
835-836(4),
926-927(2),
941-953(6),
974,
1008,
1039,
1113
Defined struct's
cht
defined in line
73;
never used
cwind
defined in line
66;
never used
place
defined in line
80;
never used
Defined typedef's
bitmat
defined in line
34; used 19 times
- in line 89-69(5),
75
- in /usr/src/old/fed/io.c line
135,
202-206(2)
- in /usr/src/old/fed/subr.c line
168-170(2),
213,
222,
317,
496,
968,
1002,
1033,
1113
Defined macros
ESC
defined in line
28; used 1 times
GLCOL
defined in line
19; used 103 times
- in line 22
- in /usr/src/old/fed/fed.c line
105,
156,
263,
320
- in /usr/src/old/fed/io.c line
38-39(2),
67-68(2),
78,
106-107(2),
221,
227,
340,
353
- in /usr/src/old/fed/subr.c line
38,
69,
125,
173,
179,
198,
206,
246-248(2),
256,
267,
282(2),
304-305(2),
376-381(2),
527-531(3),
601,
668-669(2),
679,
697-705(3),
815-819(3),
835-836(2),
924-927(3),
940-953(8),
973-986(7),
1007-1020(7),
1038-1042(3),
1051-1069(13),
1086,
1123-1129(8),
1135-1140(5)
GLPAD
defined in line
21; used 2 times
GLROW
defined in line
20; used 112 times
- in line 22
- in /usr/src/old/fed/fed.c line
105,
136,
168,
263,
320
- in /usr/src/old/fed/io.c line
38-39(2),
67-68(2),
78,
99-107(4),
221,
227,
341-346(3),
353
- in /usr/src/old/fed/subr.c line
39(2),
69-70(2),
125-126(2),
173,
179(2),
198,
206,
246-248(2),
256,
267,
279(2),
304-305(2),
326,
376-381(2),
527-531(3),
601,
668-669(2),
679,
697-705(3),
797,
815-819(3),
835-836(2),
923-927(3),
941-953(7),
973-986(7),
1007-1020(7),
1038-1041(3),
1051-1069(13),
1086,
1120-1129(5),
1136-1140(7)
NCOL
defined in line
17; used 6 times
NROW
defined in line
16; used 4 times
NWIND
defined in line
18; used 3 times
SCRHI
defined in line
14; used 3 times
SLOPE
defined in line
24; used 1 times
abs
defined in line
30; used 4 times
max
defined in line
31; used 3 times
min
defined in line
32; used 4 times
Usage of this include