wlt: load font modules during startup
authorDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 26 Sep 2012 21:47:12 +0000 (23:47 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 26 Sep 2012 21:47:12 +0000 (23:47 +0200)
We need the text-font modules to render fonts in wlterm. Therefore, load
all the font modules during startup before initializing the application.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/wlt_main.c

index ea5c8e4..34b8723 100644 (file)
@@ -37,6 +37,7 @@
 #include "conf.h"
 #include "eloop.h"
 #include "log.h"
+#include "text.h"
 #include "wlt_main.h"
 #include "wlt_terminal.h"
 #include "wlt_theme.h"
@@ -251,19 +252,24 @@ int main(int argc, char **argv)
 
        log_print_init("wlterm");
 
+       kmscon_font_load_all();
+
        memset(&app, 0, sizeof(app));
        ret = setup_app(&app);
        if (ret)
-               goto err_out;
+               goto err_unload;
 
        ev_eloop_run(app.eloop, -1);
 
        destroy_app(&app);
+       kmscon_font_unload_all();
        conf_free(options, onum);
        log_info("exiting");
 
        return EXIT_SUCCESS;
 
+err_unload:
+       kmscon_font_unload_all();
 err_out:
        conf_free(options, onum);
        log_err("cannot initialize wlterm, errno %d: %s", ret, strerror(-ret));