thanks you guys are faster then the printing library's support lol
and by using the windows unit, ExtTextOut is able to print the characters with string!?
looks like by using the windows unit, the windows API is handling the ExtTextOut, but without the windows unit, it is handled by lazarus/fpc's own implementation?
unit Unit1;
{$mode objfpc}{$H+}
{$i C:\fpcupdeluxe\fpcsrc\rtl\win\wininc\unifun.inc}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
LCLType, LCLIntf
, Windows
;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
PaintBox1: TPaintBox;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
wstr:widestring;
str:string;
therect:TRect;
begin
wstr:='AB'#251#252;
str:='AB'#251#252;
paintbox1.Canvas.Font.Name:='WingDings';
PaintBox1.Canvas.TextOut(0,0, wstr);
therect:=PaintBox1.Canvas.ClipRect;
ExtTextOut(PaintBox1.Canvas.Handle,0,20,0, @therect, pchar(str),4,nil);
ExtTextOutW(PaintBox1.Canvas.Handle,0,40,0, @therect, PWideChar(wstr),4, nil);
end;
end.