Re: mixed pango/foreign layout



Hi,

On Tue, 2004-02-03 at 10:44, Alexander Larsson wrote:
> pangolayouts). The way its done is to insert a character in the text and
> set the "Shape" attribute on the character. The shaper will then leave
> this area unpainted and you can do whatever you want with it.

Thanks again to Alexander and Tony, the "trick" worked quite well and
now I can see math within a paragraph layed out by pango. One more
question: when I have to understand where to render the embedded foreign
object, I use the pango_layout_index_to_pos method given the index of
the 0xfffc character.

Unfortunately the rectangle returned by this method is not the same
rectangle which was specified in the shape attribute associated with
that character, in particular the .y field corresponds to the topmost
edge of the line, _not_ the topmost edge of the 0xfffc character. Hence
the only way I have found to know the baseline of the line is to iterare
the layout until I find a line whose baseline is greater or equal to the
.y field obtained. A similar method is also used in gtktextlayout.c. 
I wonder if there is an alternative way of finding the baseline, or to
get the original rectangle set with the shape attribute.

Thanks,
--Luca




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