[Lazarus] FPVectorial and TAChart
Felipe Monteiro de Carvalho
felipemonteiro.carvalho at gmail.com
Wed Apr 20 10:25:08 CEST 2011
On Wed, Apr 20, 2011 at 7:15 AM, Alexander Klenin <klenin at gmail.com> wrote:
> 1) How to draw a rectangle?
> 3) How to draw a polygon?
var
ADoc: TvVectorialDocument;
begin
ADoc.StartPath(0, 0);
ADoc.AddLineToPath(100, 0);
ADoc.AddLineToPath(100, 100);
ADoc.AddLineToPath(0, 100);
ADoc.AddLineToPath(0, 0);
ADoc.EndPath();
Or do you want an entity with a brush? I can add that if necessary.
> 2) How to measure a text?
What exactly do you want to measure in the text? width? DXF and SVG
don't specify a text width AFAIK.
TvText.FontSize + TvText.FontName is the information available.
Vectorial image formats do not specify rigid sizes for text, because
it is system-independent and the text size depends on the screen/font
combination. One can use freetype or LCL or fcl-image via freetype for
measuring the text size in a particular screen / font combination.
> 4) How to make FPVectorial output anything?
> It seems crash no matter what output format I try.
The SVG and g-code outputs should work for lines and text.
The main idea was that you would also help to develop fpvectorial. The
idea was that instead of writing some custom code to write vectorial
files in TAChart you would make some improvements in fpvectorial, so
everyone is working on the same library, code is shared, improvements
are shared, etc.
> 5) IMHO intruducing yet another color type is a bad idea --
> FPVectorial is by design sacrificing efficiency in favor
> of generalization/extensibility, so I do not think a few extra bytes
> for color will matter. Please use TFPColor.
That would waste 4 bytes per segment. And for what exactly? I don't
see much use in mixing fcl-image and fpvectorial, only in the exporter
which doesn't currently work with fcl-image anyway because it lacks
some drawing functions. Most of the time fpvectorial will be used with
the LCL, which has an incompatible color format anyway without Alpha
and unavailable in the FCL.
--
Felipe Monteiro de Carvalho
More information about the Lazarus
mailing list