Thursday, 3 January 2013

Warp Text

Post is for Jabier.

Warped text has been around for a long time. What people did back then with pen and paper, painstakingly mapping points to a grid, is now possible on a mouseclick.

In Adobe Illustrator, for example, you have the Warp Text Effect, which has a neat dialogue, and you can apply the warping in percentages.

This effect is currently very difficult to achieve in Inkscape.

Doing it manually with Node editing is a lot of work....

The existing LPE's all lead to ugly deformations, instead of nice straight lines.

'Lattice Deformation 2' has too many points and arranging the points in a warped grid pattern leads to squashing:

The 'Envelope Deformation' has the same squashing problem:

Even applied to individual letters:

The 'Perspective/Envelope' only works well on individual letters but doesnt allow for a curved envelope. (also, it doesnt memorize the setting, so every time you have to 01. apply LPE to single letter, 02. change 'Type' in dropdown menu, 03. bend, 04. repeat for more letters, etc.)

This all lead to ofnuts from Gimp-Forum writing a plug-in that works on paths for Gimp

You can download the plug-in, called 'ofn-bend-path', here:

By design, the script only bends the path vertically with a two strokes envelope:

A few comments from ofnuts why its so fast:
My script does two things to be quick:
1) it handles only the existing anchors and tangents. 100 points for a word, vs several thousands when you try to interpolate things
2) the script restricts itself to cases where you need only to solve 3rd degree equations. Some algorithms end up with more complex polynomials and have to use iterative algorithms to find the roots. Others also just have 3rd degree polynomials, but don't know how to solve them directly and use the slower iterative algorithms instead.