[cairo] Cairo and ISO C++
Emmanuel PACAUD
emmanuel.pacaud at lapp.in2p3.fr
Wed Jan 15 01:42:18 PST 2014
Hi,
Le mardi 14 janvier 2014 à 15:10 -0800, Bill Spitzak a écrit :
> ZERO LINEWIDTH
>
> A huge complaint about Cairo is that it is "fuzzy". It tries to hide
> this by defaulting the line width to 2, which just makes everything look
> thick.
>
> I would change the default method of stroking a line to purposely draw
> non-antialised horizontal and vertical lines that are about 1/96 of an
> inch thick. In cairo setting the line width to 1, and offsetting any
> path that is being stroked by .5, .5 does a good job of this.
>
> To match virtually every other graphics library I have seen, this state
> can be chosen by setting the line width to zero, and is turned off by
> setting the line width to non-zero (including MINFLOAT).
>
> If this is not provided most programmers "fix" it by turning off
> antialiasing, which is not at all desirable and makes all the rest of
> the graphics look a lot worse.
The mode you describes is pretty much shape-rendering="crispEdges" in
the SVG world.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering
While it would be nice to have something like that in cairo, I don't
think the special zero linewidth approach is interresting, as crisp
edges is not limited to only one pixel strokes. And I would not have
this mode by default.
It would be better implemented as a mode set by a call to a
cairo_set_rendering_mode function, which would match the SVG model (I'm
not sure, but probably the PDF model too).
Cheers,
Emmanuel.
More information about the cairo
mailing list