Program SetTheTextStyle;
{ Linquistic High School # 20 }
{ SetTextStyle Sample program }
uses
Crt,Graph;
const
FontStyleNames : array[0..2] of string =
('SmallFont - 8x8 bit mapped font',
'MediumFont - 8x14 bit mapped fonr',
'LargeFont - 8x16 bit mapped font');
DirectionStyleNames : array[0..1] of string =
('Horizontal direction',
'Vertical direction');
var
{A loop variable}
i:Integer;
{Y coordinate}
y:Integer;
{X coordinate}
x:Integer;
begin
{ Set graphics mode at 256 colours}
SetSVGAMode(640,480,8,LfbOrBanked);
{ Sets Center and Center Text justification }
SetTextJustify(CenterText,CenterText);
{ Sets Y coordinate at first}
y:=50;
for i:=0 to 2 do
begin
SetTextStyle(i,HorizDir);
{ Shows various font styles }
OutTextXY(GetMaxX div 2,y,FontStyleNames[i]);
{ Increment the Y coordinates }
Inc(y,50);
end;
{ Sets X coordinate at first}
x:=GetMaxX div 3;
for i:=0 to 1 do
begin
SetTextStyle(LargeFont,i);
{ Shows various direction styles }
OutTextXY(x,GetMaxY div 2,DirectionStyleNames[i]);
{ Increment the X coordinates }
Inc(x,150);
end;
{ Get the key pressed }
ReadKey;
{ Return to the text mode }
CloseGraph;
end.