Rev 2226 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2226 | Rev 2232 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | /* |
|
- | 2 | Copyright 2011 dunkaist |
|
- | 3 | Distributed under the terms of the GNU General Public License v3. |
|
- | 4 | See http://www.gnu.org/licenses/gpl.txt for the full license text. |
|
- | 5 | */ |
|
- | 6 | ||
- | 7 | ||
1 | #include |
8 | #include |
Line 2... | Line 9... | ||
2 | 9 | ||
3 | int main() |
- | |
4 | { |
10 | #define FONT_HEIGHT 9 |
5 | const int font_height = 9; |
11 | #define FONT_WIDTH_MONO 5 |
- | 12 | #define FONT_WIDTH_VAR 7 /* max symbol width */ |
|
6 | int font_width[2] = {5,7}, |
13 | |
7 | char_num,i,e; |
14 | short int char_num, row, col; |
Line 8... | Line -... | ||
8 | char ch,data; |
- | |
9 | - | ||
Line 10... | Line 15... | ||
10 | freopen("char.txt","rt",stdin); |
15 | char ch, data; |
11 | freopen("CHAR.MT","wb",stdout); |
16 | |
12 | - | ||
13 | for(char_num=256;char_num;char_num--) |
17 | |
14 | { |
18 | int do_symbol(short int font_width) |
15 | fseek(stdin,8,SEEK_CUR); |
19 | { |
16 | for(e=font_height;e;e--) |
20 | for(row=FONT_HEIGHT; row; row--) |
17 | { |
21 | { |
18 | data = 0; |
22 | data = 0; |
19 | for(i=0;i |
23 | for(col=0; col |
20 | { |
- | |
21 | data |= getchar()==' '?0:1< |
24 | { |
- | 25 | data |= getchar()==' '? 0 : 1< |
|
22 | } |
26 | } |
- | 27 | putchar(data); |
|
- | 28 | fseek(stdin, 3, SEEK_CUR); |
|
- | 29 | } |
|
- | 30 | return 0; |
|
- | 31 | } |
|
- | 32 | ||
- | 33 | ||
- | 34 | int main() |
|
- | 35 | { |
|
- | 36 | freopen("char.txt", "rt", stdin); |
|
- | 37 | freopen("CHAR.MT", "wb", stdout); |
|
- | 38 | ||
- | 39 | for(char_num=256; char_num; char_num--) |
|
23 | fseek(stdin,3,SEEK_CUR); |
40 | { |
Line 24... | Line 41... | ||
24 | putchar(data); |
41 | fseek(stdin, 8, SEEK_CUR); |
25 | } |
42 | do_symbol(FONT_WIDTH_MONO); |
Line 32... | Line 49... | ||
32 | { |
49 | { |
33 | fseek(stdin,6,SEEK_CUR); |
50 | fseek(stdin, 6, SEEK_CUR); |
34 | ch = getchar(); |
51 | ch = getchar(); |
35 | putchar(ch==' '?0x08:ch-47); |
52 | putchar(ch==' '? 0x08 : ch-47); |
36 | fseek(stdin,3,SEEK_CUR); |
53 | fseek(stdin, 3, SEEK_CUR); |
37 | for(e=font_height;e;e--) |
- | |
38 | { |
- | |
39 | data = 0; |
- | |
40 | for(i=0;i |
- | |
41 | { |
- | |
42 | data |= getchar()==' '?0:1< |
- | |
43 | } |
- | |
44 | putchar(data); |
- | |
45 | fseek(stdin,3,SEEK_CUR); |
54 | do_symbol(FONT_WIDTH_VAR); |
46 | } |
- | |
47 | } |
55 | } |
48 | return 0; |
56 | return 0; |
49 | } |
57 | } |
50 | > |
58 | > |