[cairo] PATCH cairo-www: Simpler explanation for how to get sharp, single-pixel-wide lines

Bill Spitzak spitzak at gmail.com
Fri May 19 17:40:06 UTC 2017


On Fri, May 19, 2017 at 3:08 AM, Lawrence D'Oliveiro
<ldo at geek-central.gen.nz> wrote:
> On Fri, 19 May 2017 12:25:08 +0300, me at beroal.in.ua wrote:
>
>> Automatic hinting is not the same as antialiasing.

Obviously not. Not sure what the argument is.

Though I agree with some of the patch shown above (in particular
remove all the stuff about "some people don't like pixels described as
squares" which is rather opinionated, and has NOTHING to do with
whether the integers are at the pixel centers or 1/2 way between them.
The integers are 1/2 way between the pixel centers in Cairo in the
default ctm, and imagining different shapes for pixels does not and
cannot change this).

The problem with "turn off antialiasing" is that it will fail for any
lines that are not horizontal or vertical. And just saying "turn it
on/off depending on whether you are drawing horizontal/vertical lines"
is not a solution though it is implied. That will not allow the
diagonal lines to cleanly join onto the horizontal and vertical lines,
as they are in effect shifted by .5 pixel.

I do agree that Cairo really needs some kind of hinting as this is a
huge impediment for novice programmers to get any kind of nice
graphics out of it, and pretty much makes Cairo's support of
transformation unusable if you do want to fix this. It also needs to
gamma correct the antialiasing as proper antialiasing can look far
better than what Cairo is producing now.


More information about the cairo mailing list