mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 12:49:13 +02:00
textextent test: Adds a arabic test
git-svn-id: trunk@33565 -
This commit is contained in:
parent
1e32edd4db
commit
ba4bd03d8d
@ -75,6 +75,22 @@ begin
|
|||||||
Image.Canvas.Brush.Style := bsClear;
|
Image.Canvas.Brush.Style := bsClear;
|
||||||
Image.Canvas.TextOut(20, 75 + i *15, lStr);
|
Image.Canvas.TextOut(20, 75 + i *15, lStr);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Now add something hard: Arabic
|
||||||
|
lStr := 'العرب';
|
||||||
|
LCLIntf.GetTextExtentExPoint(Image.Canvas.Handle, PChar(lStr),
|
||||||
|
Length(lStr), 50, @lMaxCount, @lPartialWidths[0], lSize);
|
||||||
|
lRes := Image.Canvas.TextFitInfo(lStr, 50);
|
||||||
|
Image.Canvas.Brush.Style := bsClear;
|
||||||
|
Image.Canvas.TextOut(20, 200, Format('GetTextExtentExPoint Arabic. Returned MaxCount=%d should be aprox. 5', [lMaxCount]));
|
||||||
|
Image.Canvas.Brush.Color := clBlue;
|
||||||
|
for i := 0 to 4 do
|
||||||
|
begin
|
||||||
|
Image.Canvas.Brush.Style := bsSolid;
|
||||||
|
Image.Canvas.Rectangle(20+lSize.cx-lPartialWidths[i], 225 + i * 15, 20+lSize.cx, 240 + i * 15);
|
||||||
|
Image.Canvas.Brush.Style := bsClear;
|
||||||
|
Image.Canvas.TextOut(20, 225 + i *15, lStr);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user