View Issue Details

IDProjectCategoryView StatusLast Update
0024340LazarusLCLpublic2013-04-30 21:21
ReporterYurii Salyzhyn Assigned ToZeljan Rikalo  
Status resolvedResolutionfixed 
Product Version1.0.7 (SVN) 
Summary0024340: DrawText output is different on Bitmap.Canvas and Form.Canvas
DescriptionDrawText 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 ReproduceCreate new project and add this procedures:

procedure TForm1.FormCreate(Sender: TObject);
  Bitmap := TBitmap.Create;
  Bitmap.Width := 150;
  Bitmap.Height := 50;

procedure TForm1.FormPaint(Sender: TObject);
  s: string;
  R: TRect;
  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);
Fixed in Revision40956
Attached Files


Yurii Salyzhyn

2013-04-28 15:06


Project1.png (15,416 bytes)   
Project1.png (15,416 bytes)   

Zeljan Rikalo

2013-04-29 07:51

developer   ~0067243

This is so because of Qt-4.7/4.8 text auto recognizes layout (QPainter::layoutDirection).Seem that Qt algorithm for such operation isn't best one since different paint devices shows different results.

Zeljan Rikalo

2013-04-30 17:42

developer   ~0067300

Please test and close if ok.
Note that this will not work with qt libs < 4.7

Issue History

Date Modified Username Field Change
2013-04-28 15:06 Yurii Salyzhyn New Issue
2013-04-28 15:06 Yurii Salyzhyn File Added: Project1.png
2013-04-29 07:20 Zeljan Rikalo Assigned To => Zeljan Rikalo
2013-04-29 07:20 Zeljan Rikalo Status new => assigned
2013-04-29 07:51 Zeljan Rikalo Note Added: 0067243
2013-04-30 17:42 Zeljan Rikalo Fixed in Revision => 40956
2013-04-30 17:42 Zeljan Rikalo LazTarget => -
2013-04-30 17:42 Zeljan Rikalo Note Added: 0067300
2013-04-30 17:42 Zeljan Rikalo Status assigned => resolved
2013-04-30 17:42 Zeljan Rikalo Resolution open => fixed
2013-04-30 21:21 Zaher Dirkey Tag Attached: bidi