how to change epson lx 300 font size using escape character

hi, i am using delphi to develop application that need to emulate line printer,

my question is as the title, how to change epson lx 300 font size using escape character


thanks
enshrentkoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
twinsoftConnect With a Mentor Commented:
Hi use the following code:

type
 TPrintType = (ptBold, ptCondessed, ptLargeFont, ptMediumFont, ptUnderLine, ptItalics);

function TForm1.SetFont(aPrintType: TPrintType): String;
var
 aValue: Integer;
begin
 Result := '';
 aValue := 0;
 if Condessed in aPrintType then aValue := aValue or 4;
 if Bold in aPrintType then aValue := aValue or 8;
 if MediumFont in aPrintType then aValue := aValue or 16;
 if LargeFont in aPrintType then aValue := aValue or 32;
 if Italics in aPrintType then aValue := aValue or 64;
 if UnderLine in aPrintType then aValue := aValue or 128;
 Result := #27#33 + Chr(aValue);
end;

To use it code a procedure like this:

var
 aPType: TPrintTypes
 s: String;
begin
  aPType := [ptLargeFont]; // or other combinations
  s := SetFont(aPType);
  // then send s to the printer before printing the line
end;



0
 
enshrentkoAuthor Commented:
it works actually, but what i need is font size that smaller than MediumFont,

any insight?

thanks
0
 
twinsoftCommented:
Then you should use an empty variable

aPType := [];
0
All Courses

From novice to tech pro — start learning today.