Category : Pascal Source Code
Archive   : QUATFONT.ZIP
Filename : LOADFONT.PAS

 
Output of file : LOADFONT.PAS contained in archive : QUATFONT.ZIP

program loadfont;
{ a demo program adapted from the turbo pascal 4 users manual to
load and use the fonts on the Quattro disk. Some of these fonts
are not found with turbo 4 but seem to work fine.
I have no knowledge about the distribution of the fonts
not packaged with turbo pascal 4.
It would be a great improvement if one could via an environment
variable specify the directory to search for drivers and fonts !!!
While it is not hard in the case of initgraph it is a pain to do
so with fonts if one does not register them.

Taine Gilliam
CIS : 75406,1754
2/26/88 }

uses graph;
const
names : array[1..10] of string[4] = ('bold','euro','goth','lcom',
'litt','sans','scri','simp',
'trip','tscr');
var
driver, mode : integer;
fontf : file;
fontp : pointer;
font_number : integer;
i : integer;
begin
for i := 1 to 10 do
begin
assign(fontf,'\util\quatro\'+names[i]+'.chr'); { use your dir here }
reset(fontf,1);
getmem(fontp,filesize(fontf));
blockread(fontf,fontp^,filesize(fontf));
font_number := registerbgifont(fontp);
writeln('font number =',i,' name =',names[i]);
writeln('register number = ',font_number);
readln;
if font_number<0 then
begin
writeln('font file not found.');
halt(1)
end;

driver := detect;
initgraph(driver,mode,'\mnt\tp-dir\'); { substitute your dir here}
if graphresult <0 then
begin
writeln('driver not found');
halt(1)
end;
settextstyle(font_number,horizdir,4);
outtext('By jove I believe we have it.');
readln;
closegraph
end;
end.