[Lazarus] fpVectorial text related question

Leonardo M. Ramé l.rame at griensu.com
Mon Jun 6 15:24:27 CEST 2011


On 2011-06-06 11:06:43 +0200, Felipe Monteiro de Carvalho wrote:
> On Mon, Jun 6, 2011 at 1:32 AM, Leonardo M. Ramé <l.rame at griensu.com> wrote:
> > Hi, I would like to know how can I measure text in fpVectorial. I need
> > to draw a segment with text in the middle of the segment and I can't
> > find any helper function to do that.
> 
> It is impossible to measure text in vectorial graphics because the
> rendering font is not known. Note how, for example, AutoCAD and SVG
> don't support it. There are two possible work arounds:
> 
> 1> Try to make a clever guess based on the font info and add an extra
> safety spacing
> 2> Add script capabilities
> 
> > Example. Here's more or less what I want to draw:
> >
> > |---- 10cm ----|
> 
> That looks like a Dimension. There is an element dedicated to that:
> TvAlignedDimension
> 
> Maybe that's what you want to draw?

How can I use TvAlignedDimension?, any example?, how it looks?

> > Also, I whould like to be able to draw the text rotated to follow the
> > angle of the segment. Is this possible?
> 
> We can simply add a new element to represent that. Some questions come
> from that: As double-precision degrees or as integer 1/16 of degrees?
> Rotating in which direction for positive values? Which output do you
> use? fpvtocanvas? Or image formats?

Well, the angle of the text must be the same of the segment below it, I
don't know if it's double-precision or 1/16 int. Regarding the rotation,
it must allow rotating 360 degrees clockwise. The output is fpvtocanvas.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list