< -->
Program CPIFontExtractor;
{ofs - 3Bh,
hFont, 08, 00, 00, 00, 01}
{C:\WINDOWS\COMMAND\ega.cpi}
var
Buff : array[0..16383] of Byte;
fs, fd : file;
Sfn, dfn, Hgh, Nmb : String;
fCount : Word;
FSz, Fld : Longint;
H : Byte;
begin
fCount := 0;
if ParamCount = 0 then Halt;
Sfn:= ParamStr(1);
Sfn[0] := Chr(Byte(Sfn[0])-4);
Assign(fs, ParamStr(1));
Reset(fs, 1);
FSz := FileSize(fs);
Seek(fs, $3B);
Repeat
{$I-}
BlockRead(fs, H, 1);
{$I+}
if not (H in [8, 14, 16]) then Continue;
inc(fCount);
Str(fCount, Nmb);
Str(H, Hgh);
{$I-}
While Buff[0] <> 1 do
BlockRead(fs, Buff, 1);
BlockRead(fs, Buff, 256*H);
{$I+}
Assign(fd, Sfn+Nmb+'_'+Hgh+'.fnt');
ReWrite(fd, 1);
BlockWrite(fd, Buff, 256*H);
Close(fd);
dec(FSz, 256*H);
Until (Fsz=0) or (IOResult<>0);
Close(fs);
end.
Назад