octave-maintainers
[Top][All Lists]
Advanced

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

Re: legends in FLTK backend?


From: Jaroslav Hajek
Subject: Re: legends in FLTK backend?
Date: Tue, 19 Jan 2010 22:00:01 +0100

On Tue, Jan 19, 2010 at 9:55 PM, Michael Goffioul
<address@hidden> wrote:
> 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

Does it mean the objects would need to be rendered at this point? Or
can they be created hidden?

> 3) get text extents
> 4) size the axes properly and reposition the text objects
>
> Michael.
>



-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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