typedef unsigned char byte; typedef unsigned int word; typedef long unsigned int dword; #include #include #include #include #include #include #include #include #include int f; word a,x,y,p; byte buf[16*3*1024L]; byte far * vga=MK_FP(0xa000,0); struct { byte head[4]; word x; word y; byte bpp; byte bypp; byte flg; } fnthead; byte t; void main (byte _argc,byte **_args) { if (_argc!=2) { printf("usage:Font outfile\n"); exit(0); } f=open(_args[1],O_BINARY|O_CREAT|O_TRUNC|O_WRONLY,S_IWRITE); if (f==-1) { printf("file io error\n"); exit(0); } strcpy(fnthead.head,"FNT"); fnthead.head[3]=0x1a; fnthead.x=8; fnthead.y=8; fnthead.bpp=24; fnthead.bypp=3; fnthead.flg=0; write(f,&fnthead,sizeof(fnthead)); asm { mov ax,19 int 16 } for (a=0;a<256;a++){ gotoxy(1,1); if (a!=7) printf("%c",a); else printf(" "); for(y=0;y<8;y++) { for(x=0;x<8;x++) { t=*(vga+y*320+x); if (t) t=255; buf[p++]=t; buf[p++]=t; buf[p++]=t; } } } asm { mov ax,3 int 16 } write(f,buf,16*1024*3L); close(f); printf("done\n"); }