You've already forked lazarus-ccr
Adds a font orientation property and moves the font to a separate record
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1667 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -153,6 +153,18 @@ type
|
||||
function Next(): TPathSegment;
|
||||
end;
|
||||
|
||||
TvFont = record
|
||||
Color: TvColor;
|
||||
Size: integer;
|
||||
Name: utf8string;
|
||||
{@@
|
||||
Font orientation is measured in degrees and uses the
|
||||
same direction as the LCL TFont.orientation, which is counter-clockwise.
|
||||
Zero is the normal, horizontal, orientation.
|
||||
}
|
||||
Orientation: Double;
|
||||
end;
|
||||
|
||||
{@@
|
||||
TvText represents a text in memory.
|
||||
|
||||
@ -163,9 +175,7 @@ type
|
||||
public
|
||||
X, Y, Z: Double; // Z is ignored in 2D formats
|
||||
Value: utf8string;
|
||||
FontColor: TvColor;
|
||||
FontSize: integer;
|
||||
FontName: utf8string;
|
||||
Font: TvFont;
|
||||
end;
|
||||
|
||||
{@@
|
||||
@ -744,8 +754,8 @@ begin
|
||||
lText.X := AX;
|
||||
lText.Y := AY;
|
||||
lText.Z := AZ;
|
||||
lText.FontName := FontName;
|
||||
lText.FontSize := FontSize;
|
||||
lText.Font.Name := FontName;
|
||||
lText.Font.Size := FontSize;
|
||||
FTexts.Add(lText);
|
||||
end;
|
||||
|
||||
|
@ -491,7 +491,8 @@ begin
|
||||
for i := 0 to ASource.GetTextCount - 1 do
|
||||
begin
|
||||
CurText := ASource.GetText(i);
|
||||
ADest.Font.Size := Round(AmulX * CurText.FontSize);
|
||||
|
||||
ADest.Font.Size := Round(AmulX * CurText.Font.Size);
|
||||
ADest.Pen.Style := psSolid;
|
||||
{$ifdef USE_LCL_CANVAS}
|
||||
ADest.Pen.Color := clBlack;
|
||||
@ -499,7 +500,9 @@ begin
|
||||
ADest.Pen.FPColor := colBlack;
|
||||
{$endif}
|
||||
ADest.Brush.Style := bsClear;
|
||||
LowerDim.Y := CurText.Y + CurText.FontSize;
|
||||
ADest.Font.Orientation := Round(CurText.Font.Orientation * 16);
|
||||
|
||||
LowerDim.Y := CurText.Y + CurText.Font.Size;
|
||||
ADest.TextOut(CoordToCanvasX(CurText.X), CoordToCanvasY(LowerDim.Y), CurText.Value);
|
||||
end;
|
||||
end;
|
||||
|
@ -243,7 +243,7 @@ begin
|
||||
AData, lText.X, lText.Y, PtX, PtY);
|
||||
|
||||
TextStr := lText.Value;
|
||||
FontSize:= ceil(lText.FontSize / FLOAT_MILIMETERS_PER_PIXEL);
|
||||
FontSize:= ceil(lText.Font.Size / FLOAT_MILIMETERS_PER_PIXEL);
|
||||
SVGFontFamily := 'Arial, sans-serif';//lText.FontName;
|
||||
|
||||
AStrings.Add(' <text ');
|
||||
|
Reference in New Issue
Block a user