From bafe7cab287f395b9e4b0eb9ee828e22b2b46180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 4 Dec 2019 22:01:39 +0100 Subject: [PATCH] main: stop initializing a default set of fonts --- main.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/main.c b/main.c index fc007857..ed426d4b 100644 --- a/main.c +++ b/main.c @@ -60,23 +60,6 @@ term_shutdown_cb(void *data, int exit_code) ctx->exit_code = exit_code; } -static bool -initialize_fonts(const struct config *conf, struct font *fonts[4]) -{ - const size_t count = tll_length(conf->fonts); - const char *names[count]; - - size_t i = 0; - tll_foreach(conf->fonts, it) - names[i++] = it->item; - - return ( - (fonts[0] = font_from_name(names, count, "dpi=96")) != NULL && - (fonts[1] = font_from_name(names, count, "dpi=96:weight=bold")) != NULL && - (fonts[2] = font_from_name(names, count, "dpi=96:slant=italic")) != NULL && - (fonts[3] = font_from_name(names, count, "dpi=96:weight=bold:slant=italic")) != NULL); -} - int main(int argc, char *const *argv) { @@ -181,7 +164,6 @@ main(int argc, char *const *argv) setlocale(LC_ALL, ""); - struct font *fonts[4] = {NULL}; struct fdm *fdm = NULL; struct wayland *wayl = NULL; struct terminal *term = NULL; @@ -190,10 +172,6 @@ main(int argc, char *const *argv) log_init(as_server ? LOG_FACILITY_DAEMON : LOG_FACILITY_USER); - /* This ensures we keep a set of fonts in the cache */ - if (!initialize_fonts(&conf, fonts)) - goto out; - if ((fdm = fdm_init()) == NULL) goto out; @@ -237,9 +215,6 @@ out: wayl_destroy(wayl); fdm_destroy(fdm); - for (size_t i = 0; i < sizeof(fonts) / sizeof(fonts[0]); i++) - font_destroy(fonts[i]); - config_free(conf); log_deinit(); return ret == EXIT_SUCCESS && !as_server ? shutdown_ctx.exit_code : ret;