Hi there.
Please have a look at the following image:
On the left you see a normal TMemo straight from the VCL.
On the right, we have a TeeChart with a TRectangleTool on it. By themselves, they both look fine.
However, I am puzzled about the different line height of the TRectangleTool. There is more space between the lines. Is there a way to adjust the "line spacing"? I have found no way.
Many thanks in advance.
Adjusting line height of TRectagleTool
-
- Newbie
- Posts: 31
- Joined: Fri Nov 21, 2014 12:00 am
Re: Adjusting line height of TRectagleTool
Hello,
Can you please attach here that simple test project?
Can you please attach here that simple test project?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 31
- Joined: Fri Nov 21, 2014 12:00 am
Re: Adjusting line height of TRectagleTool
Sure. There's not much magic involved:
Code: Select all
procedure TForm3.createTool();
begin
textRectangle := TRectangleTool.Create(Chart);
textRectangle.ParentChart := Chart;
textRectangle.Shape.Font.Assign(Font);
textRectangle.Shape.Font.Color := TColors.Black; // I have no clue why this is necessary
textRectangle.Text := Memo1.Lines.Text;
textRectangle.Bounds := textRectangle.ParentChart.ClientRect;
textRectangle.Shape.Transparency := 0;
Chart.Tools.Add(textRectangle);
end;
- Attachments
-
- TextRectangleTool.zip
- (5.14 KiB) Downloaded 758 times
Re: Adjusting line height of TRectagleTool
Hello,
Thanks for sharing the test project.
This is because TeeChart uses GDIPlus by default since a few releases ago and different techniques are used to calculate the TextHeight.
Adding this to your test project gives a more similar result at both sides:
Thanks for sharing the test project.
This is because TeeChart uses GDIPlus by default since a few releases ago and different techniques are used to calculate the TextHeight.
Adding this to your test project gives a more similar result at both sides:
Code: Select all
type
TCanvasAccess=class(TTeeCanvas3D);
//...
Chart.Canvas:=TTeeCanvas3D.Create;
TCanvasAccess(Chart.Canvas).FontQuality:=fqClearType;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 31
- Joined: Fri Nov 21, 2014 12:00 am
Re: Adjusting line height of TRectagleTool
Yes, they're almost identical now. Thank you.
It still has a pretty different ... padding compared to a TMemo but I think I can sort that out. Thanks again.
It still has a pretty different ... padding compared to a TMemo but I think I can sort that out. Thanks again.