Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2232 dunkaist 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
 
2226 leency 8
#include 
9
 
2232 dunkaist 10
#define	FONT_HEIGHT	    9
11
#define FONT_WIDTH_MONO	    5
12
#define FONT_WIDTH_VAR	    7   /* max symbol width */
2226 leency 13
 
2232 dunkaist 14
    short int   char_num, row, col;
15
    char        ch, data;
2226 leency 16
 
2232 dunkaist 17
 
18
int do_symbol(short int font_width)
19
{
20
    for(row=FONT_HEIGHT; row; row--)
2226 leency 21
    {
2232 dunkaist 22
        data    =   0;
23
        for(col=0; col
2226 leency 24
        {
2232 dunkaist 25
            data    |=  getchar()==' '? 0 : 1<
2226 leency 26
        }
2232 dunkaist 27
        putchar(data);
28
        fseek(stdin, 3, SEEK_CUR);
2226 leency 29
    }
2232 dunkaist 30
    return 0;
31
}
2226 leency 32
 
33
 
2232 dunkaist 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--)
2226 leency 40
    {
2232 dunkaist 41
        fseek(stdin, 8, SEEK_CUR);
42
        do_symbol(FONT_WIDTH_MONO);
43
    }
44
 
45
    freopen("char2.txt", "rt", stdin);
46
    freopen("CHAR2.MT", "wb", stdout);
47
 
48
    for(char_num=256; char_num; char_num--)
49
    {
50
        fseek(stdin, 6, SEEK_CUR);
2226 leency 51
        ch  =   getchar();
2232 dunkaist 52
        putchar(ch==' '? 0x08 : ch-47);
53
        fseek(stdin, 3, SEEK_CUR);
54
        do_symbol(FONT_WIDTH_VAR);
2226 leency 55
    }
56
    return 0;
2232 dunkaist 57
}