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 14:43:58 +0100

On Tue, Jan 19, 2010 at 10:22 AM, Michael Goffioul
<address@hidden> wrote:
> On Tue, Jan 19, 2010 at 7:00 AM, John W. Eaton <address@hidden> wrote:
>> On 19-Jan-2010, Jaroslav Hajek wrote:
>>
>> | Thanks, John, Michael.
>> | I suppose the first thing to start with is determining the text
>> | extents. Any suggestions?
>>
>> We've had some discussions about this on the maintainers list and I
>> think there is some code in src/txt-eng-ft.cc, src/txt-eng-ft.h, and
>> src/txt-eng.h.
>>
>> Could we please move this discussion to the maintainers list?
>
> The text engine code provides a framework to do text processing.
> It implements a parser that decompose a text string into tokens
> (for the time being, it only generates a single text token, no real
> parsing). It also defines a visitor pattern to do text processing.
>
> There has been initial code proposed to compute text extent.
> See [1]. This might be a good start.
>
> Michael.
>
> [1] 
> http://www-old.cae.wisc.edu/pipermail/octave-maintainers/2009-March/011571.html
>

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?

-- 
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]