[cairo] A Question

Bill Spitzak spitzak at gmail.com
Tue Feb 26 19:15:38 UTC 2019

The above answers are being a bit complex.

The real answer is: Cairo is absolutely designed so that non-integer line
widths and/or line positions work.

It will attempt to simulate the result as best it can using anti-aliasing
(ie drawing some pixels not fully opaque).

The complexity in the answer is due to two things: 1. this is impossible to
do perfectly if intermediate data only consists of one value for each
pixel. 2: there are bugs and/or sub-optimal implementations in Cairo.

On Tue, Feb 26, 2019 at 9:41 AM Bryce Harrington <bryce at bryceharrington.org>

> On Fri, Feb 22, 2019 at 04:59:43PM -0800, Thomas Dineen wrote:
> > Gentle People:
> >
> >    A question on Cairo: The X Y inputs to Cairo drawing functions are
> type
> > double.
> >
> > Dose this imply that pixel or line spacing could be less than 1.0?
> >
> > Could the spacing be say 0.5 or 0.25?
> Cairo does track the decimal positioning, although beware there is some
> culling behavior that can kick in when you're < 1.0, that could make
> things disappear unexpectedly.  I don't think the documentation goes
> into the culling rules in much depth, and there may be some
> inconsistencies in how it's handled so may be down to experimentation
> and/or code study.
> There's a FAQ item that's about a slightly different issue but might be
> of interest:
>   https://www.cairographics.org/FAQ/#sharp_lines
> HTH,
> Bryce
> --
> cairo mailing list
> cairo at cairographics.org
> https://lists.cairographics.org/mailman/listinfo/cairo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20190226/134d72f0/attachment.html>

More information about the cairo mailing list