unit PclCodes;
interface
type
TPCLCodes =
class
public type
TPrimarySpacing = ( Fixed, Proportional );
private const
ESC = #27;
public const
PrimarySpacing_Fixed = ESC + '
(s0P';
PrimarySpacing_Proportional = ESC + '
(s1P';
PrimarySmbolSet_ASCII = ESC + '
(0U';
PrimarySmbolSet_Legal = ESC + '
(1U';
PrimarySymbolSet_Win_3_1_Latin1 = ESC + '
(9U';
PrimarySymbolSet_PC_8 = ESC + '
(10U';
PrimarySymbolSet_PC_8_DN = ESC + '
(11U';
PrimarySymbolSet_PC_850 = ESC + '
(12U';
PrimarySymbolSet_Pi_FONT = ESC + '
(15U';
PrimarySymbolSet_PC_852 = ESC + '
(17U';
PrimarySymbolSet_ANSI = ESC + '
(19U';
PrimarySymbolSet_ISO_80 = ESC + '
(0D';
PrimarySmbolSet_ISO_8859_1 = ESC + '
(0N';
PrimarySmbolSet_ISO_8859_2 = ESC + '
(2N';
PrimarySmbolSet_ISO_8859_9 = ESC + '
(5N';
PrimarySymbolSet_Latin1 = PrimarySmbolSet_ISO_8859_1;
PrimarySymbolSet_Latin2 = PrimarySmbolSet_ISO_8859_2;
PrimarySymbolSet_Latin5 = PrimarySmbolSet_ISO_8859_9;
PrimarySymbolSet_Latin1_ANSI = PrimarySymbolSet_ANSI;
private const
PrimaryPitchFormat = ESC + '
(s%dH';
PrimaryHeightFormat = ESC + '
(s%dV';
PrimarySpacingValues:
array [ TPrimarySpacing ]
of string = ( PrimarySpacing_Fixed, PrimarySpacing_Proportional );
public
class function PrimarySpacing( Value: TPrimarySpacing ):
string;
class function PrimaryPitch( CharactersPerInch: Integer ):
string;
class function PrimaryHeight( Points: Integer ):
string;
end;
implementation
uses
System.SysUtils;
{ TPCLCodes }
class function TPCLCodes.PrimaryHeight( Points: Integer ):
string;
begin
Result := Format( PrimaryHeightFormat, [ Points ] );
end;
class function TPCLCodes.PrimaryPitch( CharactersPerInch: Integer ):
string;
begin
Result := Format( PrimaryPitchFormat, [ CharactersPerInch ] );
end;
class function TPCLCodes.PrimarySpacing( Value: TPrimarySpacing ):
string;
begin
Result := PrimarySpacingValues[ Value ];
end;
end.