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

Render fonts slightly nicer #2677

Merged
merged 1 commit into from
Sep 22, 2018
Merged

Render fonts slightly nicer #2677

merged 1 commit into from
Sep 22, 2018

Conversation

ggreer
Copy link
Contributor

@ggreer ggreer commented Sep 21, 2018

Set cairo font options to render text and lines with subpixel hinting (if available).

I've been running sway with this patch for several months and I prefer it.

@ddevault
Copy link
Contributor

You need to actually provide the hints, too. Check the wlr_output's subpixel geometry.

@ggreer
Copy link
Contributor Author

ggreer commented Sep 21, 2018

Ah, yeah. The actual patch I was using had an extra line setting subpixel order to CAIRO_SUBPIXEL_ORDER_RGB, since that's what my monitors use.

@emersion emersion changed the title Render fonts slightly nicer [WIP] Render fonts slightly nicer Sep 21, 2018
@emersion
Copy link
Member

Ah, yeah. The actual patch I was using had an extra line setting subpixel order to CAIRO_SUBPIXEL_ORDER_RGB, since that's what my monitors use.

Please extract this piece of information from wl_output::geometry.

@ianyfan
Copy link
Contributor

ianyfan commented Sep 21, 2018

Ref #1685?

@ggreer ggreer force-pushed the pretty-fonts branch 2 times, most recently from 88b665c to ee77c00 Compare September 22, 2018 18:28
@ggreer
Copy link
Contributor Author

ggreer commented Sep 22, 2018

Before (antialiased) antialiased
After (subpixel rendering) subpixel

@ddevault
Copy link
Contributor

Nice.

common/cairo.c Outdated
case WL_OUTPUT_SUBPIXEL_VERTICAL_BGR:
return CAIRO_SUBPIXEL_ORDER_VBGR;
default:
return CAIRO_SUBPIXEL_ORDER_DEFAULT;
Copy link
Contributor

Choose a reason for hiding this comment

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

style nit: align case with switch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. I wonder if there's a clang-format rule for that.

Copy link
Contributor

Choose a reason for hiding this comment

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

We've looked into clang-format before, unfortunately there are a few issues with our style that it doesn't support.

@ddevault
Copy link
Contributor

LGTM aside from one minor style issue

… text and lines with subpixel hinting (if available).
@ggreer ggreer changed the title [WIP] Render fonts slightly nicer Render fonts slightly nicer Sep 22, 2018
@ddevault ddevault merged commit 082488a into swaywm:master Sep 22, 2018
@ddevault
Copy link
Contributor

Thanks!

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

4 participants