[cairo] line width questions

Bill Spitzak spitzak at thefoundry.co.uk
Wed Aug 20 12:35:06 PDT 2008

It does sound like SVG has zero mean an invisible line.

Since zero line width is not going to be accepted, I think the proper 
cairo API would be to add a function that turns hairline mode on. You 
turn it off by setting the line width to any value (including zero).

The reason for this apparently strange way of turning it off is that it 
is necessary if cairo can be implemented on backends that use linewidth 
of zero to indicate hairline mode, and to avoid any questions about what 
different line widths mean in hairline mode, so that a different 
high-speed line-drawing algorithm can be used. The line caps and joins 
may be ignored as well but changing them does not turn off hairline mode.

M Joonas Pihlaja wrote:
> On Mon, 18 Aug 2008, Bill Spitzak wrote:
>> Also OpenGL, Windows GDI, GDI+, PDF, AGG, SVG, DirectX, SilverLight, and
>> a whole lot of others use "zero line width" to mean a special line
>> drawing algorithim.
> Uhm.. sorry for butting in here, but as I stifled myself earlier
> exactly because of this point and now you bring it up, I want to
> mention this.  Turns out that in SVG a zero stroke width does not
> turn on hair line mode:
>  http://www.w3.org/TR/SVG11/painting.html#StrokeWidthProperty

Bill Spitzak, Senior Software Engineer
The Foundry, 618 Hampton Drive, Venice, CA, 90291, USA
Tel: +1 310 399-4555 * Fax: +1 310 450-4516 * Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027

More information about the cairo mailing list