Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpret "subpixel none" as CAIRO_ANTIALIAS_GRAY #5239

Merged
merged 1 commit into from
Apr 20, 2020

Conversation

imyxh
Copy link
Contributor

@imyxh imyxh commented Apr 20, 2020

Fixes issue #5228. Currently, WL_OUTPUT_SUBPIXEL_NONE is ignored and CAIRO_ANTIALIAS_SUBPIXEL is still set. This commit checks if subpixel is set to none and if so, calls set_antialias with CAIRO_ANTIALIAS_GRAY. This mirrors the functionality in Mako's PR261.

@progandy brought up that we could alternatively "extend it to 'none' = no antialias, 'gray' = grayscale" and/or read from the fontconfig setup.

See issue swaywm#5228. Currently, WL_OUTPUT_SUBPIXEL_NONE is ignored and
CAIRO_ANTIALIAS_SUBPIXEL is still set. This commit checks if subpixel is
set to none and if so, calls set_antialias with CAIRO_ANTIALIAS_GRAY.
This mirrors the functionality in Mako's
[PR261](emersion/mako#261)
@emersion
Copy link
Member

emersion commented Apr 20, 2020

we could alternatively "extend it to 'none' = no antialias, 'gray' = grayscale"

Subpixel none doesn't mean no antialias. Subpixel none means that the physical pixels don't have a geometry, ie. antialiasing shouldn't make any assumption about subpixel geometry.

read from the fontconfig setup.

I wonder if Cairo already does that by default?

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, this change LGTM. Thanks!

@emersion emersion merged commit 276e030 into swaywm:master Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants