Previous: SetTextJustify procedure To the Table of Content Next: SetSplineLineSteps procedure

- 4.37.2.113 -
Standard Units
Graph Unit
Graph Unit Procedures and Functions

SetTextStyle procedure

Targets: MS-DOS, Win32


Sets style for text output in graphics mode.

Declaration:
procedure SetTextStyle(Font, Direction: DWORD);
Return Value: None Typical Usage:
SetTextStyle(SmallFont, Vertical);
SetTextStyle(1,0);
Remarks: Sets the current text font, and character magnification factor. Sample Code:
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.


Previous: SetTextJustify procedure To the Table of Content Next: SetSplineLineSteps procedure
SetTextJustify procedure Table of Content SetSplineLineSteps procedure

- 4.37.2.113 -