Re: mixed pango/foreign layout



Luca Padovani <lpadovan cs unibo it> wrote at Tue, 10 Feb 2004 12:54:48 +0100:
...
> 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.

A solution that I use but don't think is sufficiently well thought out
(hence my delay in replying until it is clear no-one else will) is to
add a 'callback' attribute type that is used in conjunction with the
'shape' attribute.  I also added code to the render() routine that,
for a 'callback' attribute, moves the "point" to the top-left corner
of the "glyph" (i.e., the shape when used with the 'shape' attribute)
then invokes the callback to do the rendering of the foreign object.

As I said, I hesitate to recommend it to you.

Regards,


Tony Graham
------------------------------------------------------------------------
Web Products, Technologies and Standards           Phone: +353 1 8199708
Sun Microsystems                                              x(70)19708
East Point Business Park, Dublin 3, Ireland




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