|
From: | xianghang liu |
Subject: | Re: about contibuting to octave |
Date: | Mon, 23 Mar 2009 16:29:53 +0800 |
On Fri, Mar 13, 2009 at 11:27 AM, xianghang liu <address@hidden> wrote:As Shai said, that's the job of the text processors. Consider the string a_{11}
> 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.
(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.
[Prev in Thread] | Current Thread | [Next in Thread] |