TAChart: Improve font size support in fpvectorial back-end

git-svn-id: trunk@30527 -
This commit is contained in:
ask 2011-05-02 12:09:38 +00:00
parent 88604dfc35
commit 0830ff3c25

View File

@ -30,6 +30,7 @@ type
strict private strict private
FBrushColor: TvColor; FBrushColor: TvColor;
FCanvas: TvVectorialDocument; FCanvas: TvVectorialDocument;
FFontSize: Integer;
FPenColor: TvColor; FPenColor: TvColor;
strict protected strict protected
function GetFontAngle: Double; override; function GetFontAngle: Double; override;
@ -70,7 +71,7 @@ type
implementation implementation
uses uses
TAChartUtils, TAGeometry; Math, TAChartUtils, TAGeometry;
function ChartColorToVColor(AColor: TChartColor): TvColor; function ChartColorToVColor(AColor: TChartColor): TvColor;
begin begin
@ -244,7 +245,7 @@ end;
procedure TFPVectorialDrawer.SetFont(AFont: TFPCustomFont); procedure TFPVectorialDrawer.SetFont(AFont: TFPCustomFont);
begin begin
// Not implemented. FFontSize := IfThen(AFont.Size = 0, 10, AFont.Size);
end; end;
procedure TFPVectorialDrawer.SetPen(APen: TFPCustomPen); procedure TFPVectorialDrawer.SetPen(APen: TFPCustomPen);
@ -261,8 +262,8 @@ end;
function TFPVectorialDrawer.SimpleTextExtent(const AText: String): TPoint; function TFPVectorialDrawer.SimpleTextExtent(const AText: String): TPoint;
begin begin
Result.X := Length(AText) * 8; Result.X := FFontSize * Length(AText) * 2 div 3;
Result.Y := 8; Result.Y := FFontSize;
end; end;
procedure TFPVectorialDrawer.SimpleTextOut( procedure TFPVectorialDrawer.SimpleTextOut(