DrawText output is different on Bitmap.Canvas and Form.Canvas
Original Reporter info from Mantis: salyzhyn
-
Reporter name: Yurii Salyzhyn
Original Reporter info from Mantis: salyzhyn
- Reporter name: Yurii Salyzhyn
Description:
DrawText output is different on Bitmap.Canvas and Form.Canvas for strings which combine arabic and other symbols (Linux, qt). See attached screenshot.
Strings like this 'Pa ,تنش' are shown in a proper way both in Linux and Windows but not this '% ,خطأ نسبي' or ':مایع تحقیق'.
Steps to reproduce:
Create new project and add this procedures:
procedure TForm1.FormCreate(Sender: TObject);
begin
Bitmap := TBitmap.Create;
Bitmap.Width := 150;
Bitmap.Height := 50;
end;
procedure TForm1.FormPaint(Sender: TObject);
var
s: string;
R: TRect;
begin
s := '% ,خطأ نسبي';
R := Rect(10, 10, 200, 40);
DrawText(Form1.Canvas.Handle, PChar(s), Length(s), R, DT_WORDBREAK or DT_RTLREADING);
DrawText(Bitmap.Canvas.Handle, PChar(s), Length(s), R, DT_WORDBREAK or DT_RTLREADING);
Form1.Canvas.Draw (10, 40, Bitmap);
end;
Mantis conversion info:
- Mantis ID: 24340
- OS: Kubuntu
- OS Build: 12.04
- Build: 40563
- Platform: i386
- Version: 1.0.7 (SVN)
- Fixed in revision: 40956 (#e70b5f66)