[cairo] render text along path

Behdad Esfahbod behdad at behdad.org
Tue Nov 25 07:34:13 PST 2008


Kevin Atkinson wrote:
> For what I was doing, I actually want the text to warp, so that's all to
> the good.
> 
> The remaining challenge is warping text along b-splines or beziers. 
> You'll note that in the warpedtext.py example, the paths that the text
> is warped along are simple little curves - a spiral and a circle.  I
> want to warp text along a spline, and so need to parametrize it by
> arclength, which is not completely trivial, and generate a normal to the
> spline.  I've found a couple useful references in this regard, but if
> anyone knows of some existing code that plays nice with cairo already,
> it would be greatly appreciated.

My cairotwisted code that I posted earlier does exactly that:

http://svn.gnome.org/viewvc/pango/trunk/examples/cairotwisted.c?view=markup

behdad

> Cheers,
> 
> Kevin
> 
> On Tue, Nov 25, 2008 at 3:34 AM, Dirk Schönberger
> <dirk.schoenberger at sz-online.de <mailto:dirk.schoenberger at sz-online.de>>
> wrote:
> 
> 
>     > Pycairo comes with the example examples/warpedtext.py which draws text
>     > along a path.
>     >
> 
>     The example looks interesting.
>     The only problem I see is that this method warps the actual glyphs.
>     In a pure text on path I think the glyphs should be only rotated,
>     transformed or scaled, while the actual "point data" (outlines) are not
>     changed.
> 
>     Regards
>     Dirk
> 
>     _______________________________________________
>     cairo mailing list
>     cairo at cairographics.org <mailto:cairo at cairographics.org>
>     http://lists.cairographics.org/mailman/listinfo/cairo
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list