[Lazarus] fpVectorial text related question

Alexander Klenin klenin at gmail.com
Mon Jun 6 14:14:14 CEST 2011

On Mon, Jun 6, 2011 at 13:06, Felipe Monteiro de Carvalho
<felipemonteiro.carvalho at gmail.com> 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

How about adding a capability to measure text, implemented only for those
back-ends that support it, like screen and printer?
Yet another alternative would be to introduce text-based distance units,
similar to "en" and "em" in HTML/SVG.

Alexander S. Klenin

More information about the Lazarus mailing list