Expose cairo antialiasing abilities · Issue #8784 · matplotlib/matplotlib · GitHub
Skip to content

Expose cairo antialiasing abilities #8784

Description

@anntzer

Currently, the cairo backend does not support setting antialiasing:

    #def set_antialiased(self, b):
        # enable/disable anti-aliasing is not (yet) supported by Cairo

This comment is no longer true; in fact many antialiasing modes have been supported for a while (and can be easily set):
https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-antialias
https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t

The issue is that True/False is not sufficient to describe the antialiasing modes. Should we, say, allow the user to pass in a string value ("default"/"none"/"gray"/etc.)? Passing a "native" cairo value won't work, as they are simply integers (and exposed as such by cairocffi, and as int subclasses by pycairo), and ANTIALIAS_DEFAULT=0 (which includes some antialiasing) and ANTIALIAS_NONE=1, which will conflict with the integer values of False=0, True=1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions