diff options
author | Geoff Greer <[email protected]> | 2018-09-20 20:37:08 -0700 |
---|---|---|
committer | Geoff Greer <[email protected]> | 2018-09-22 11:34:21 -0700 |
commit | c495164f6059d8f352afeead86a510365cc802a1 (patch) | |
tree | ee7316a573d5feb5332bb5cef509bd37faf5bcf7 /swaybar/render.c | |
parent | eae42606e2f6956013c0f68c090b4c0fbc3bee72 (diff) |
swaybar, swaylock, & tree/container: Set cairo font options to render text and lines with subpixel hinting (if available).
Diffstat (limited to 'swaybar/render.c')
-rw-r--r-- | swaybar/render.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/swaybar/render.c b/swaybar/render.c index 26db80cb..9413dc57 100644 --- a/swaybar/render.c +++ b/swaybar/render.c @@ -495,6 +495,13 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) { cairo_surface_t *recorder = cairo_recording_surface_create( CAIRO_CONTENT_COLOR_ALPHA, NULL); cairo_t *cairo = cairo_create(recorder); + cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST); + cairo_font_options_t *fo = cairo_font_options_create(); + cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL); + cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_SUBPIXEL); + cairo_font_options_set_subpixel_order(fo, to_cairo_subpixel_order(output->subpixel)); + cairo_set_font_options(cairo, fo); + cairo_font_options_destroy(fo); cairo_save(cairo); cairo_set_operator(cairo, CAIRO_OPERATOR_CLEAR); cairo_paint(cairo); |