[cairo] Summer of Code ideas

James Cloos cloos at jhcloos.com
Thu Mar 27 21:34:34 PDT 2008

>>>>> "Jeff" == Jeff Muizelaar <jeff at infidigm.net> writes:

Jeff> I haven't come across a 'textbook' algorithm for doing
Jeff> stroke_to_path.  I've looked at a bunch different implementations
Jeff> and there's a fair amount of variation among them. A lot of it
Jeff> depends on the requirements for the result. Cairo's stroking code,
Jeff> for example, produces trapezoids targeted at rasterization
Jeff> backends.

Fontforge has an implementation that may be worth examining.  George
splits outlining the stroke and removing overlaps into two separate
functions.  Both end up using numerical methods to fit splines to the
new path.  (I beleive I recall a comment in the code that he tried
analytical algorithms but fell back to numerical because the latter had
better performance and/or gave better results.)

I've tested it a bit and found the results to be reasonable.

(As it is BSDish, FF is also licence-compatable with cairo.)

Support for converting a pen+stroke to a (set of) fillable outline(s)
would be a great addition to cairo.

James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

More information about the cairo mailing list