octave-maintainers
[Top][All Lists]
Advanced

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

Re: about contibuting to octave


From: Michael Goffioul
Subject: Re: about contibuting to octave
Date: Sat, 14 Mar 2009 10:11:44 +0100

On Fri, Mar 13, 2009 at 11:27 AM, xianghang liu <address@hidden> wrote:
> Since I am not familiar with freetype, I have no ideas about how it deals
> with subscripts and superscripts. Please give me some suggestions if you
> know that.
> Thanks.

As Shai said, that's the job of the text processors. Consider the string a_{11}
(a subscript 11). A parser split this string into a datastructure containing a
recursive container pattern; this structure will probably contain 2
top elements:
a text element and a subscripted element. For each of those elements, you can
compute a BB, [x1 y2 w1 h1] and [x2 y2 w2 h2]. Let's consider that you text
processor will offset the subscript by p pixels (in practice, this should be
computed from the font metrics of the subscripted element; for instance half
of the font ascent). The BB of the complete text can be computed as:

[x1 min(y1,y2-p) w1+w2 max(h1,h2+p)]

Michael.


reply via email to

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