In flake there already is a text shape using the kotext library for displaying all sort of text boxes. But as Karbon is a vector drawing application there are some special needs which are rightly not implemented in the default text shape. One of these special cases is text on path support, i.e. having a text line flowing along a given path. So I recently started to implement a new simple flake text shape which renders the character outlines using QPainterPath. Having the single chars as path objects makes it pretty easy to move and rotate them around so that they can follow arbitrary curves as their baseline. And i must say with the path classes from Qt4 that is amazingly simple.
Additionally having the path based text makes it automatically possible to define the stroke (outline) and the fill with the default stroke and fill tools. So you can have dashed outlines and gradient fill in your text for example.
Below is a screenshot showing the path based text shape in action. The basic features already work quite nice. But it is still somewhat slow as there is some infrastructure work still required within flake. That is needed so that the text is automatically updated if the attached path it flows on is changed.

7.12.2007 at 01:15 |
Please note that in Qt4.3.3 the boolean operators for vector paths have been debugged and generally made really nice. I think you can use those too.
7.12.2007 at 01:25 |
Heh that’s nice! I already use the boolean stuff in karbon, so if they are improved karbon will automatically benefit.
7.12.2007 at 09:32 |
As I understand this is another text object. I think this is bad, to have several text tools. For example I draw picture and need functionality of both object in one text label or I simple take wrong object that’s lack functionality, then start painting my picture.
And it’s hard to maintain!
Have you plans for margin your implementation with existing, or may be your tool replace current one?
sorry for my English.
7.12.2007 at 09:35 |
That looks excellent, well done!
Cheers,
Rob.
7.12.2007 at 19:32 |
@dima: I think both text shapes have very different use cases. The kotext based text shape is all about correct text layouting for e.g in text boxes. The other one i added is more about artistic text like putting it on a path, deforming it (non linear) and exact positioning. So the later is more practical for a vector drawing which is more targeted to the artistic user. So i think it makes sense to have them separate. But maybe i change the name to Artistic Text Shape or something like that to make really clear what its purpose is.
@Rob: Well thanks
It has still a long way to go, but is a nice start.