Language:
Русский
English
RgBGIfnt.PAS
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
{ Example for RegisterBGIFont }
uses Graph;
var
Driver, Mode: Integer;
FontF: file;
FontP: pointer;
begin
{ Open font file, read, register }
Assign(FontF, 'TRIP.CHR');
Reset(FontF, 1);
GetMem(FontP, FileSize(FontF));
BlockRead(FontF, FontP^,
FileSize(FontF));
if RegisterBGIfont(FontP) < 0 then
begin
WriteLn('Error registering font: ',
GraphErrorMsg(GraphResult));
Halt(1);
end;
{ Init graphics }
Driver := Detect;
InitGraph(Driver, Mode, '..\');
if GraphResult < 0 then
Halt(1);
ReadLn;
{ Select registered font }
SetTextStyle(TriplexFont, HorizDir, 4);
OutText('Triplex loaded by user program');
MoveTo(0, TextHeight('a'));
ReadLn;
{ Select font to be loaded from disk }
SetTextStyle(SansSerifFont, HorizDir, 4);
OutText('Your disk should be spinning..');
MoveTo(0, GetY + TextHeight('a'));
ReadLn;
{ Re-select font (already in memory) }
SetTextStyle(TriplexFont, HorizDir, 4);
OutText('Back to Triplex');
ReadLn;
CloseGraph;
end.