2011-09-22 20:34:55 +02:00
|
|
|
/*
|
|
|
|
Copyright 2011 dunkaist <dunkaist@gmail.com>
|
|
|
|
Distributed under the terms of the GNU General Public License v3.
|
|
|
|
See http://www.gnu.org/licenses/gpl.txt for the full license text.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-09-22 12:47:11 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2011-09-22 20:34:55 +02:00
|
|
|
#define FONT_HEIGHT 9
|
|
|
|
#define FONT_WIDTH_MONO 5
|
|
|
|
#define FONT_WIDTH_VAR 7 /* max symbol width */
|
2011-09-22 12:47:11 +02:00
|
|
|
|
2011-09-22 20:34:55 +02:00
|
|
|
short int char_num, row, col;
|
|
|
|
char ch, data;
|
2011-09-22 12:47:11 +02:00
|
|
|
|
2011-09-22 20:34:55 +02:00
|
|
|
|
|
|
|
int do_symbol(short int font_width)
|
|
|
|
{
|
|
|
|
for(row=FONT_HEIGHT; row; row--)
|
2011-09-22 12:47:11 +02:00
|
|
|
{
|
2011-09-22 20:34:55 +02:00
|
|
|
data = 0;
|
|
|
|
for(col=0; col<font_width; col++)
|
2011-09-22 12:47:11 +02:00
|
|
|
{
|
2011-09-22 20:34:55 +02:00
|
|
|
data |= getchar()==' '? 0 : 1<<col;
|
2011-09-22 12:47:11 +02:00
|
|
|
}
|
2011-09-22 20:34:55 +02:00
|
|
|
putchar(data);
|
|
|
|
fseek(stdin, 3, SEEK_CUR);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
freopen("char.txt", "rt", stdin);
|
|
|
|
freopen("CHAR.MT", "wb", stdout);
|
|
|
|
|
|
|
|
for(char_num=256; char_num; char_num--)
|
|
|
|
{
|
|
|
|
fseek(stdin, 8, SEEK_CUR);
|
|
|
|
do_symbol(FONT_WIDTH_MONO);
|
2011-09-22 12:47:11 +02:00
|
|
|
}
|
|
|
|
|
2011-09-22 20:34:55 +02:00
|
|
|
freopen("char2.txt", "rt", stdin);
|
|
|
|
freopen("CHAR2.MT", "wb", stdout);
|
2011-09-22 12:47:11 +02:00
|
|
|
|
2011-09-22 20:34:55 +02:00
|
|
|
for(char_num=256; char_num; char_num--)
|
2011-09-22 12:47:11 +02:00
|
|
|
{
|
2011-09-22 20:34:55 +02:00
|
|
|
fseek(stdin, 6, SEEK_CUR);
|
2011-09-22 12:47:11 +02:00
|
|
|
ch = getchar();
|
2011-09-22 20:34:55 +02:00
|
|
|
putchar(ch==' '? 0x08 : ch-47);
|
|
|
|
fseek(stdin, 3, SEEK_CUR);
|
|
|
|
do_symbol(FONT_WIDTH_VAR);
|
2011-09-22 12:47:11 +02:00
|
|
|
}
|
|
|
|
return 0;
|
2011-09-22 20:34:55 +02:00
|
|
|
}
|