Re: [Inkscape-devel] Re: [cairo] Pango + cairo



> There's a big patch from Damon Chaplin outstanding to redo the
> line layout part of Pango to add justification. I haven't had the
> time to fully review it yet. It's pretty darn complex. If it turns 
> out that we can't just replace the current code wholesale, that patch
> may be a good point to look at making line-layout pluggable.

You may like to look at the documentation for what I've written at
http://www.inkscape.org/doc/doxygen/html/classInkscape_1_1Text_1_1Layout.php
which should give an idea of the sort of things a graphics application
needs out of a text layout library. As you have already commented, the
amount of code taken up by the layout engine is smaller than the
ancilliary IO stuff. While looking at the functions that are
available, you should be aware that several of them only exist because
I thought they would be useful, not because I actually had a use in
mind.

> Non-greedy linebreaking is very challenging to do with good
> internationalized shaping. (I think Damon spent some time trying
> to figure out and then gave up.) But if someone had a spare month,
> I think it's definitely possible. And I wouldn't mind shipping
> it with Pango, as long as it was optional. As well as performance
> considerations, it is just the wrong behavior for most interactive
> applications.

Actually, I don't have any concrete plans to do non-greedy line
breaking for Inkscape. The code I replaced did have a Knuth-Plass
implementation, but it only worked for simpler shapes. The SVG spec
specifies greedy.

> Non-rectangular layout, on the other hand, is pretty easy. It's
> not totally trivial when you have mixed fonts within a line and
> thus uneven line spacing, but I think the main challenge there is
> simply coming up with a good interface for representing the shape
> to Pango.

Again, you might like to look at the interface I'm using for that.
It's in C++ of course, but it is a working example of one way to do
it. http://www.inkscape.org/doc/doxygen/html/classInkscape_1_1Text_1_1Layout_1_1ScanlineMaker.php

Richard.




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