Hi Martin,
Martin Sevior wrote:
> Right now only Tomas Frydrich understands what is actually happening
> in many places. we need to get that knowledge more widely spread.
I fear that reflects more on the quality of the code than the complexity
of the problem; it's really quite simple, particularly if you use pencil
and paper to visualize it better.
> For example we have a bug report that Arabic shaping breaks after
> apostrophe characters. If more developers understood the class we
> could get more brain power working on why this happens and fix it.
The basic problem is that for the shaping to work completely reliably,
the pango_shape() function should be run on text of an entire paragraph
in a single pass. We do not do that, but shape one run at a time, on the
assumption that runs only get spit at such points that do not impact on
the shape of the parts. In the case of the apostrophe this probably is
not the case.
The ultimate solution would be to rewrite the shaping logic so that
instead of storing the pango glyph strings in each run, we store one
glyph string in each fl_BlockLayout, and the text runs keep track of
their start and end offsets in that glyph string. The font and language
attributes would need to be translated into appropriate pango attributes
for this as well. I dare not to say how much work this would involve,
and it would come with a performance overhead, which might or might not
be significant. Also I am not entirely sure how the win32 backend would
tie into it, it might be simpler if windows too moved to using cairo
first so that all of this could be pulled into the xp base class.
Tomas
Received on Tue Jul 14 18:48:46 2009
This archive was generated by hypermail 2.1.8 : Tue Jul 14 2009 - 18:48:46 CEST