[cairo] render text along path

Bobby Salazar bobby8934 at inbox.com
Wed Nov 26 15:35:25 PST 2008



>> Thanks for the screenshot. I have been able to get this code to work now
>> and it's pretty cool. Thanks Behdad! You never cease to amaze me.
> 
> Glad you liked it :).
> 
>> The code seems to work great for paths that are just connected lines and
>> curves. However, it looks like this code does not treat "close path"
>> operations properly because it does not map the text path back to the
>> beginning point of the current sub path. It also seems to treat "move
>> to" operations as if they were "line to" operations, at least in the
>> resulting mapped path (i.e. it does not insert a "move to" in the
>> correct place to break the text path nicely).
>> 
>> Fixing the handling of "close path" seems not too bad, given a good hint
>> on where to start (I don't understand the math involved in this example
>> code). But after giving further thought to the "move to" problem, it
>> seems harder than it first appears because you would have to figure out
>> how to properly close the shape. If anyone can help suggest where in the
>> code I should look, I would be interested in at least making an attempt
>> at fixing this and sharing the results.
> 
> I fixed the close_path issue.  Check pango trunk or refresh the viewvc
> page.

Great! I'll take a look and give it a try.

> The move_to issue, there's not much to do about it.  What do you want it
> to do?

I suppose that ideally it should split the path and close the resulting two paths nicely. For instance, suppose you are running the letter 'W' through the cairotwisted code, and the path it is using to map onto is a move_to, line_to, followed by a move_to, line_to, and that these line_to's are exactly half the length of the letter 'W', so basically it's a straight horizontal line with a break in the middle. I would want it to draw the 'W' as two 'V' letters in this case. But currently what it does is draw the two 'V' letters, with connecting lines between them where they would normally join to form the 'W' letter.

I hope that description makes sense. Basically, if someone was drawing this by hand on a piece of paper, their brush should lift off the paper and resume drawing at the new move_to point. The current code does not break the text path apart to replicate the proper move_to behavior. But this does not seem very trivial either, at least not to me.

____________________________________________________________
GET FREE 5GB EMAIL - Check out spam free email with many cool features!
Visit http://www.inbox.com/email to find out more!


More information about the cairo mailing list