diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-01-18 18:58:14 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-01-18 18:58:14 +0000 |
| commit | 7a00c7ddf44eadedd917f4ae6e446f915c2f470c (patch) | |
| tree | f7f4e697298e8ef564b78d86585f8c8a79b2ebb3 | |
| parent | Merge branch 'releases/1.1' (diff) | |
term: enable subpixel antialiasing if background is opaque
| -rw-r--r-- | terminal.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -515,11 +515,23 @@ initialize_fonts(struct terminal *term, const struct config *conf) snprintf(attrs2, sizeof(attrs2), "dpi=%u:slant=italic", dpi); snprintf(attrs3, sizeof(attrs3), "dpi=%u:weight=bold:slant=italic", dpi); - return ( + bool ret = ( (term->fonts[0] = font_from_name(names, count, attrs0)) != NULL && (term->fonts[1] = font_from_name(names, count, attrs1)) != NULL && (term->fonts[2] = font_from_name(names, count, attrs2)) != NULL && (term->fonts[3] = font_from_name(names, count, attrs3)) != NULL); + + LOG_DBG("%s subpixel antialiasing", conf->colors.alpha == 0xffff + ? "enabling" : "disabling"); + + if (conf->colors.alpha == 0xffff) { + font_enable_subpixel_antialias(term->fonts[0]); + font_enable_subpixel_antialias(term->fonts[1]); + font_enable_subpixel_antialias(term->fonts[2]); + font_enable_subpixel_antialias(term->fonts[3]); + } + + return ret; } struct terminal * |
