aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar
diff options
context:
space:
mode:
authorLibravatar llyyr <llyyr.public@gmail.com>2023-02-26 16:12:19 +0530
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2023-02-27 13:55:08 -0500
commitb757ef94ef15093b8851598f85ef047379c341b5 (patch)
tree9dc46fba788ac87e197546e47a04afb067120e3b /swaybar
parentfix typo (diff)
downloadsway-b757ef94ef15093b8851598f85ef047379c341b5.tar.gz
sway-b757ef94ef15093b8851598f85ef047379c341b5.tar.zst
sway-b757ef94ef15093b8851598f85ef047379c341b5.zip
sway{,bar}: use default font hint style
CAIRO_HINT_STYLE_FULL attempts to maximize contrast at the expense of fidelity, this makes most fonts that haven't been hand hinted, which makes up the majority of fonts out there, appear much worse. In the absence of explicitly set hint style, cairo will default to CAIRO_HINT_STYLE_SLIGHT, which attempts to improve contrast while retaining fidelity to the original shapes, which is what we want.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/render.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index ccf36563..6a983e97 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -774,14 +774,12 @@ void render_frame(struct swaybar_output *output) {
774 ctx.cairo = cairo; 774 ctx.cairo = cairo;
775 775
776 cairo_font_options_t *fo = cairo_font_options_create(); 776 cairo_font_options_t *fo = cairo_font_options_create();
777 cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL);
778 cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_GRAY); 777 cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_GRAY);
779 ctx.textaa_safe = fo; 778 ctx.textaa_safe = fo;
780 if (output->subpixel == WL_OUTPUT_SUBPIXEL_NONE) { 779 if (output->subpixel == WL_OUTPUT_SUBPIXEL_NONE) {
781 ctx.textaa_sharp = ctx.textaa_safe; 780 ctx.textaa_sharp = ctx.textaa_safe;
782 } else { 781 } else {
783 fo = cairo_font_options_create(); 782 fo = cairo_font_options_create();
784 cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL);
785 cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_SUBPIXEL); 783 cairo_font_options_set_antialias(fo, CAIRO_ANTIALIAS_SUBPIXEL);
786 cairo_font_options_set_subpixel_order(fo, 784 cairo_font_options_set_subpixel_order(fo,
787 to_cairo_subpixel_order(output->subpixel)); 785 to_cairo_subpixel_order(output->subpixel));