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

Can't disable subpixel rendering in title bars #5228

Closed
imyxh opened this issue Apr 17, 2020 · 3 comments
Closed

Can't disable subpixel rendering in title bars #5228

imyxh opened this issue Apr 17, 2020 · 3 comments

Comments

@imyxh
Copy link
Contributor

imyxh commented Apr 17, 2020

So, I asked a question about this on Reddit a few months ago, but I guess I never reported a GitHub issue. I'm now fairly certain it's a bug so here we go.

image

The image above is a snapshot of my title bar. It's very clearly using subpixel rendering—which in my opinion, on my display, looks awful. To make it clearer, here's a screenshot of a screenshot in GIMP:

image

I have set my sway config like so:

# (in: ~/.config/sway/config)
output * subpixel none

I have also disabled it in conf.d:

$ file /etc/fonts/conf.d/10-no-sub-pixel.conf
/etc/fonts/conf.d/10-no-sub-pixel.conf: symbolic link to ../conf.avail/10-no-sub-pixel.conf

And for the most part, it works. Screenshot from terminal:

image

You can open that up in GIMP and tell that indeed, there is only grayscale antialiasing, and no subpixel rendering.

Mako, however ...

image

... also displays the same issue as the sway window titlebars. These tests are all using the same font (Iosevka 10). I've checked plenty of applications; for the most part, they all use grayscale antialiasing; even black-on-white text in Firefox uses grayscale. Everything—wayland and xwayland—seems to use my grayscale setting except Mako and the titlebars.

How may I help debug further to find the cause of this subpixel rendering? You would expect the output * subpixel none command to turn it off.

@progandy
Copy link
Contributor

progandy commented Apr 18, 2020

The renderers in sway and mako translate WL_OUTPUT_SUBPIXEL_NONE to subpixel antialias with default subpixel order. It should probably be changed to choose grayscale antialiasing instead.

Edit: Or maybe extend it to "none" = no antialias, "gray" = grayscale, "default" = default subpixel. Another option may be to respect the fontconfig setup for the antialias settings and only change the subpixel order if subpixel rendering is requested by fontconfig.

By the way, if you think subpixel rendering looks bad by default, try the other pixel orders as well.
http://www.lagom.nl/lcd-test/subpixel.php

@imyxh
Copy link
Contributor Author

imyxh commented Apr 18, 2020

Wow, thanks! I actually can't reproduce this on swaybar as of today. Though I think I could a few months ago.

imyxh added a commit to imyxh/sway that referenced this issue Apr 20, 2020
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 pushed a commit that referenced this issue Apr 20, 2020
See 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](emersion/mako#261)
@imyxh
Copy link
Contributor Author

imyxh commented Apr 20, 2020

Closed by PR5239. We can open a new issue if we want to further look at fontconfig.

@imyxh imyxh closed this as completed 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

No branches or pull requests

2 participants