]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Move pango_cairo_font_map_set_default() to font.c
authorJohan Malm <jgm323@gmail.com>
Sat, 31 Oct 2020 15:41:06 +0000 (15:41 +0000)
committerJohan Malm <jgm323@gmail.com>
Sat, 31 Oct 2020 15:41:06 +0000 (15:41 +0000)
include/common/font.h
src/common/font.c
src/main.c

index 9832c667ff13dcd07853c7239b7b16f7f009f5a4..701ead53afd41991243657675589fe30386e7786 100644 (file)
@@ -7,4 +7,10 @@
  */
 int font_height(const char *font_description);
 
+/**
+ * font_finish - free some font related resources
+ * Note: use on exit
+ */
+void font_finish(void);
+
 #endif /* __LABWC_FONT_H */
index 1eaf6c6288de851ad4d474367332fcd9c2e1ea56..5053cc1e32fa812f770307dd15e64b032a06de17 100644 (file)
@@ -42,3 +42,9 @@ font_height(const char *font_description)
        rectangle = font_extents(font_description, "abcdefg");
        return rectangle.height;
 }
+
+void
+font_finish(void)
+{
+       pango_cairo_font_map_set_default(NULL);
+}
index efcaf5ffaf624eb4ffee28c4474209c82fcac8d8..0e40af5cf4a665089bdb34f9c4f3b3ade3e82af6 100644 (file)
@@ -1,13 +1,11 @@
 #include "common/spawn.h"
+#include "common/font.h"
 #include "config/session.h"
 #include "labwc.h"
 #include "theme/theme.h"
 #include "xbm/xbm.h"
 #include "menu/menu.h"
 
-#include <cairo.h>
-#include <pango/pangocairo.h>
-
 struct rcxml rc = { 0 };
 struct theme theme = { 0 };
 
@@ -95,6 +93,6 @@ main(int argc, char *argv[])
        server_finish(&server);
        rcxml_finish();
        menu_finish(server.rootmenu);
-       pango_cairo_font_map_set_default(NULL);
+       font_finish();
        return 0;
 }