2 * Copyright (c) 1992, 1993, 1994 by Hellmuth Michaelis
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Hellmuth Michaelis.
17 * 4. The name of the developer may not be used to endorse or promote
18 * products derived from this software without specific prior written
21 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * fed.c, 3.00, last edit-date: [Sun Jan 2 20:08:45 1994]
35 /*---------------------------------------------------------------------------
37 * fed.c font editor main file
38 * -------------------------------------
40 * written by Hellmuth Michaelis, hm@hcshh.hcs.de
42 * -hm first public release
43 * -hm activating font save
45 *---------------------------------------------------------------------------*/
51 void main(int argc, char *argv[])
59 fprintf(stderr,"EGA/VGA Fonteditor, Rel 1.00\n");
60 fprintf(stderr,"usage: %s <fontfilename>\n",argv[0]);
64 readfont(argv[1]); /* read fontfile into memory */
75 addstr(" Interactive EGA/VGA Fonteditor - (c) 1993, 1994 Hellmuth Michaelis ");
78 /* character horizontal ruler */
80 move(WINROW-1, CHCOL + ((WIDTH16 - ch_width)/2) + 1);
81 if(ch_width == WIDTH16)
82 addstr("1234567890123456");
86 /* charcater vertical ruler */
88 for(i=1; i < ch_height+1; i++)
89 mvprintw((WINROW+i), (CHCOL + ((WIDTH16 - ch_width)/2) - 2), "%2d", i);
92 /* select horizontal ruler */
94 move(WINROW-1,SETCOL+2);
95 addstr("0 1 2 3 4 5 6 7 8 9 A B C D E F ");
97 /* select vertical ruler */
100 mvaddch((WINROW+i+1),(SETCOL-1),(i+'0'));
102 mvaddch((WINROW+10+i+1),(SETCOL-1),(i+'A'));
104 /* label available commands window */
106 move(WINROW-1,CMDCOL+1);
113 cmd_win = newwin(((WSIZE)+(2*WBORDER)),(CMDSIZE+(2*WBORDER)),
115 keypad(cmd_win,TRUE);
116 idlok(cmd_win, TRUE);
117 box(cmd_win,'|','-');
121 /* character font window */
123 ch_win = newwin((ch_height+(2*WBORDER)),(ch_width+(2*WBORDER)),
124 WINROW, CHCOL+((WIDTH16 - ch_width)/2));
131 /* character select window */
133 set_win = newwin((WSIZE+(2*WBORDER)),((WSIZE*2)+(2*WBORDER)),
134 WINROW,SETCOL); /* whole character set */
135 keypad(set_win,TRUE);
136 idlok(set_win, TRUE);
138 box(set_win,'|','-');
145 mvwprintw(set_win,row+1,col+1,"%02.2X",i);
161 if((ret = selectc()) == 1)
168 /*---------------------------------- E O F ----------------------------------*/