Complex text layouts

When I was looking for some thing wrt complex text layouts, I came up to the GTK+ guys and asked them whether they have seen some code to layout text in some complex ways (e.g. float around some image). Matthias gave me some hints and finally I found the Text Widget (which is not what the name promises).

The code generally does this: create some polygons; one which may contain text, others that should not be covered by text. Then it creates lots of GnomeCanvasText items and places them over the polygons arranged in a way that enables text floating around the polygons (so Matthias, you have benn wrong with the hint that it is a patch for pango; but that not so important).

Finally I got that code running, added some optimizations and got rid of some C++ code (now it's only plain C - which it has been only up to 80% before). The thing is now quite fast - even on my powerbook (that things is really a LOT slower with this application than the x86 machines I've been testing this on).

Next steps are: split the code into more logical parts (the "event" event handler for the canvas items is not really nice this way); remove the global variables and then start creating some structures tha can do text-layout in a way that PangoLayout can.

(Before you ask for the sources let me mention that they look really ugly at the moment and that I need to resolve a license issue before I publish my modifications, sorry)

Trackback URL for this post:

http://web.herzi.eu/en/trackback/6