octave-maintainers
[Top][All Lists]
Advanced

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

Re: Graphics: Title and label properties


From: Michael Goffioul
Subject: Re: Graphics: Title and label properties
Date: Tue, 22 Jul 2008 10:51:52 +0200

On Mon, Jul 21, 2008 at 10:39 PM, Maciek Gajewski
<address@hidden> wrote:
>> Based on that, computing the text extent means parsing the text
>> representation tree with a fontmetrics provider (here we thought
>> naturally about using FreeType library).
>
> Whoa!
>
> I don't get it - why such a features _inside_ octave? Isn't it backend stuff?
> thought that octave only provides backend with text position (in plot
> coordinates) and string (be it plain or TeX). Why such a low-level features
> in core graphics code?

For several reasons, but the 3 main ones are:
- we want any backend to produce more or less the same graphics results
- we want to avoid duplicate coding effort in backends and provide
a common framework where possible.
- grouping coding power instead of spreading it (we already have so
few people to do the work...)

You could go for a simple "draw_text" method in the backend, but this
mean that each backend would have to implement its own TeX parser,
potentially producing different results or different support level (the backend
A support this symbol, while the backend B does not). Not having some
font metrics information at octave level makes almost impossible to
implement correct label/title auto-location, as well as other things like
legend positioning or axes margin computation. Again this would have
to be done in the backend, spreading coding effort.

All in all, I think it's wiser to provide a common framework where
possible. Text representation and parsing seems to be a good
candidate. The rendering would still be left to the backend, but at
least the text content is already analyzed and decomposed, which
makes life of the renderer somewhat easier.

Michael.


reply via email to

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