home *** CD-ROM | disk | FTP | other *** search
- {$R+,S+,I+,D+,T-,F-,V+,B-,N-,L+ }
- { M 16384,0,16384 }
-
- { >>> CHECK STATMENTS FLAGGED WITH !PATH! BEFORE RUNNING! <<< }
-
- uses
- crt;
-
- const
- copyright : array[1..66] of char =
- 'Copyright 1988 by Sam Denton, St. Louis, MO, CompuServ 76314,1512.';
- dashes = '-----------------------------------------------------------';
-
- var
- i : integer;
- c : char;
- font : file;
- stuff : record
- offset : word;
- name : array[1..4] of char;
- size : word;
- junk : array[1..4] of byte;
- end;
- buffer, WidthTable, PlotCmds : record
- case integer of
- 1: (ptr : pointer);
- 2: (ofs,seg : word);
- end;
- first16 : record
- filler1 : byte;
- NbrChars : word;
- filler2 : byte;
- LowerBound : byte;
- OffsetP : word;
- filler3 : byte;
- MaxY : shortint;
- filler4 : byte;
- MinY : shortint;
- filler5 : array[1..5] of byte;
- end;
-
- begin
-
- WriteLn(dashes);
- for i := 1 to 4 do
- begin
- case i of
- 1: Assign(font,'c:\turbo\pascal\litt.chr'); {!PATH!}
- 2: Assign(font,'c:\turbo\pascal\goth.chr'); {!PATH!}
- 3: Assign(font,'c:\turbo\pascal\sans.chr'); {!PATH!}
- 4: Assign(font,'c:\turbo\pascal\trip.chr'); {!PATH!}
- end;
- Reset(font,1);
- repeat
- BlockRead(font,c,1);
- Write(c);
- until c = ^Z;
- WriteLn;
- BlockRead(font,stuff,sizeof(stuff));
- WriteLn('Important part of file is ',stuff.size,' bytes long.');
- Seek(font,stuff.offset);
- GetMem(buffer.ptr,stuff.size);
- BlockRead(font,buffer.ptr^,stuff.size);
- move(buffer.ptr^,first16,16);
- with first16 do
- begin
- WriteLn('NbrChars=',NbrChars,' LowerBound=',LowerBound,
- ' OffsetP=',OffsetP,' MaxY=',MaxY,' MinY=',MinY);
- WriteLn('TextHeight(''A'')=',MaxY-MinY);
- WidthTable.ptr := ptr(buffer.seg,buffer.ofs + 2*NbrChars + 16);
- WriteLn('TextWidth(''A'')=',
- byte(ptr(WidthTable.seg,WidthTable.ofs + ord('A') - LowerBound)^));
- PlotCmds.ptr := ptr(buffer.seg,buffer.ofs + 16 + 2*(ord('A') - LowerBound));
- PlotCmds.ptr := ptr(buffer.seg,buffer.ofs + OffsetP + word(PlotCmds.ptr^));
- WriteLn('Plot commands for ''A'', (1:x,0:y)=MoveTo, (1:x 1:y)=LineTo');
- repeat
- Write('(',byte(PlotCmds.ptr^) shr 7,':',byte(PlotCmds.ptr^) and $7F);
- inc(PlotCmds.ofs);
- Write(',',byte(PlotCmds.ptr^) shr 7,':',byte(PlotCmds.ptr^) and $7F);
- inc(PlotCmds.ofs);
- WriteLn(')');
- until word(PlotCmds.ptr^) = 0;
- end;
- close(font);
- WriteLn(dashes);
- delay(2500);
- end;
- end.