aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-19 11:44:21 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-19 11:44:21 +0000
commit767a0ec232a184261f8727314a72a9085057a7ab (patch)
treeaa5d2433a91e72c33745e942276792d2859baa87
parentmeson/PKGBUILD: need fcft >= 0.4.3 to configure subpixel antialiasing (diff)
fcft: update to 1.0.0
Allow/disallow subpixel antialiasing in font_glyph_for_wc(), not using font_enable_subpixel_antialias().
-rw-r--r--PKGBUILD2
-rw-r--r--meson.build2
-rw-r--r--render.c5
-rw-r--r--terminal.c14
4 files changed, 6 insertions, 17 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 77ab8e76..d46090b8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ arch=('x86_64')
url=https://codeberg.org/dnkl/foot
license=(mit)
makedepends=('meson' 'ninja' 'scdoc' 'python' 'ncurses' 'wayland-protocols' 'tllist>=1.0.0')
-depends=('libxkbcommon' 'wayland' 'pixman' 'fcft>=0.4.3')
+depends=('libxkbcommon' 'wayland' 'pixman' 'fcft>=1.0.0')
source=()
pkgver() {
diff --git a/meson.build b/meson.build
index 894a81f4..615bfa40 100644
--- a/meson.build
+++ b/meson.build
@@ -25,7 +25,7 @@ wayland_cursor = dependency('wayland-cursor')
xkb = dependency('xkbcommon')
tllist = dependency('tllist', version: '>=1.0.0', fallback: ['tllist', 'tllist'])
-fcft = dependency('fcft', version: ['>=0.4.3', '<0.5.0'], fallback: ['fcft', 'fcft'])
+fcft = dependency('fcft', version: ['>=1.0.0', '<2.0.0'], fallback: ['fcft', 'fcft'])
wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')
diff --git a/render.c b/render.c
index 70da55ef..39a9f58c 100644
--- a/render.c
+++ b/render.c
@@ -418,7 +418,8 @@ render_cell(struct terminal *term, pixman_image_t *pix,
struct font *font = attrs_to_font(term, &cell->attrs);
const struct glyph *glyph = cell->wc != 0
- ? font_glyph_for_wc(font, cell->wc) : NULL;
+ ? font_glyph_for_wc(font, cell->wc, term->colors.alpha == 0xffff)
+ : NULL;
int cell_cols = glyph != NULL ? max(1, glyph->cols) : 1;
@@ -934,7 +935,7 @@ render_search_box(struct terminal *term)
if (i == term->search.cursor)
draw_bar(term, buf->pix, font, &fg, x, y);
- const struct glyph *glyph = font_glyph_for_wc(font, term->search.buf[i]);
+ const struct glyph *glyph = font_glyph_for_wc(font, term->search.buf[i], true);
if (glyph == NULL)
continue;
diff --git a/terminal.c b/terminal.c
index 40ca8953..ffc2dbbf 100644
--- a/terminal.c
+++ b/terminal.c
@@ -515,23 +515,11 @@ 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);
- bool ret = (
+ return (
(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 *