octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: legends in FLTK backend?


From: Michael Goffioul
Subject: Re: legends in FLTK backend?
Date: Tue, 19 Jan 2010 20:55:11 +0000

On Tue, Jan 19, 2010 at 1:43 PM, Jaroslav Hajek <address@hidden> wrote:
> Hi Michael,
>
> I was thinking about creating a function, say, __get_text_extent__,
> accepting a string (or cellstr) and font size/face/weight (or possibly
> other options), and outputting the width and height of the text when
> rendered. I think there is already some kind of this calculation in
> txt-eng-ft.cc, and I hoped this could be reused.
> I would then call this function from legend.m and use the extents to
> compute a good layout of the texts, and finally create the text
> objects, one for each legend string. Do you see any potential problem
> with this approach?

No. OTOH, I'd prefer to see an approach implementing and using
the extent text property. This would give you more benefit.
The produce the legend, you'd then have to do the following:
1) create axes
2) create text objects
3) get text extents
4) size the axes properly and reposition the text objects

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]