Tuesday, November 07, 2006

Text on a path

Yesterday a rather large selection of trolls went to see Borat and while waiting for the movie to start Simon and I started talking about adding support for layouting of text on a path in Qt. I've sat down today, did the necessary math and added some extra members to QPainterPath and QBezier to make it all work. As always I wrote a short demo to illustrate what I'm talking about. I felt a little guilty tough because while I never blog about politics I see more and more people on planetkde feeling obliged to share their opinions on the world of politics. So my hard hitting politically charged statement for today is "i really like cookies". Discuss among yourselves.
With visual aids the results of it all are shown in this short Ogg Theora video file here and the screenshots look like this:


It's actually pretty neat (the code, not the fact that I like cookies). It's not yet integrated at all within the QTextDocument (also the code and not the cookies) framework but hopefully we'll be able to figure something out (both the code and the cookies) before Qt 4.3.

11 comments:

gj said...

nice job Zack.
Zajebiste :)

Louis said...

I can't believe you would come out in support of cookies. Do you know how bad they are, with there addictive flavors and high caloric content?! I mean, sure, others have posted their political views, but you've crossed the line with your cookie-loving propaganda.

Matthias Kretz said...

Very cool!

I was surprised to get to see a Theora video, though. How did you do it?

... you remember me asking you about screen-capture. I'm still interested. :-)

Anonymous said...

Boy, it's cool.

I mean the code.
And the cookies.

And you're cool too.

Anonymous said...

Down with the motherfucking cookies.

Anonymous said...

Wow! Really impressive! I hope that Scribus will take advantage of it! It would be SO cool!

Anonymous said...

Thank you. For not spouting an unimformed political view, and the great programming work your are doing.

I'm amused by all the political posts I've seen. I guess I'm old enough to know there are good people and ideas on both sides; and also that my side will not win all elections. I'm not a moderate when I say the above either, I'm very extreme.

shamaz said...

Wonderful !

I really hope it will be in Qt 4.3, and that koffice 2 will be able to use this.

avox said...

Well, Scribus already has "text along path"! :-)

And Zack's code would need some tweaking anyway. From the screenshot it looks as if the position and angle don't match exactly, and the kerning is plainly missing.

I would be interested to see the code since Scribus's text-along-path feature is due for an overhaul also soon. Does your code work with nonspacing marks and ligatures? Do you plan to apply extra kerning in narrow bends?

Cheers
/Andreas

PS: Only my mom's cookies are good! Down with all other cookies! :-)

nescius said...

that theora video is cool, it's actually too cool for my computer so every videoplayer get entire system stuck! i have tried xine and also mplayer frontends.
so someone asked this before, but how did you do that?? ;(

Peter Lund said...

The 'l' looks lonely.