Re: pango: spacing bug



Malcolm-Rannirl <rannirl-gnome otherkin net> writes:

> The todo list has:
> 
> Implement the spacing parameter
>         The spacing parameter needs to be implemented as illustrated
>         in the API docs. this should be a quick (10 minute) addition.
> 
> If this is a 10 minute fix, how would it be done?
> 
> Currently I'm having a problem with it in that pango_layout_index_to_pos 
> takes spacing into account, but pango_ft2_render_layout does not. This is 
> causing problems trying to get display elements to line up (they only line up 
> if spacing is set to zero, which introduces some other problems that can be 
> worked around but are bothersome).
> 
> I've tried to work out which pieces of the code use spacing and which don't, 
> but the code is non-obvious in many places. (Thus it would be at least a week 
> fix for me to work out, not a ten minute one).
> 
> Pointers in the right direction, or a patch, much appreciated.

The best thing to do would be to redo pango_ft2_render_layout
to use PangoLayoutIter. See gtk+/gdk/gdkpango.c for how that would 
work.

It's probably a bit more than 10 minutes of work, but removes a 
lot of duplication of logic and will make sure that how PangoFT2
renders always exactly corresponds to how PangoLayout thinks
things should be layed out.

(The render functions in Pango were written before PangoLayoutIter
were added, and have rotted a bit because GTK+ no longer uses
them the layout and layout-line level rendering functions for
individual backends.)

Regards,
                                        Owen



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