TsgDXFText.HAlign : Change the vertical position ?
Posted: 08 Nov 2010, 16:06
Hello
i must draw a center text ( Horizontal ). I use TsgDXFText and your CADExportDemo exemple code:
i add this line, in your code:
function TForm1.AddText1: TsgDXFText;
begin
Result := TsgDXFText.Create;
Result.Text := 'Text';
Result.Point := MakeFPoint(10, 280, 0);
Result.Height := 10;
Result.SetColor(clTeal);
Result.HAlign := 1; -----------------> MY NEW LINE
Result.Layer := FCADFile.Converter.LayerByName(cnstLayerName);
if not AddEntityToLayout(Result) then
begin
Result.Free;
Result := nil;
end;
end;
Problem: The text is not center, and this Y position moved ( ?? )
What is the solution ?
Thansk
Pascal EY.
i must draw a center text ( Horizontal ). I use TsgDXFText and your CADExportDemo exemple code:
i add this line, in your code:
function TForm1.AddText1: TsgDXFText;
begin
Result := TsgDXFText.Create;
Result.Text := 'Text';
Result.Point := MakeFPoint(10, 280, 0);
Result.Height := 10;
Result.SetColor(clTeal);
Result.HAlign := 1; -----------------> MY NEW LINE
Result.Layer := FCADFile.Converter.LayerByName(cnstLayerName);
if not AddEntityToLayout(Result) then
begin
Result.Free;
Result := nil;
end;
end;
Problem: The text is not center, and this Y position moved ( ?? )
What is the solution ?
Thansk
Pascal EY.