diff nuklear_ui/font.c @ 1936:2c1c88cd1a3f mame_interp

Merge from default
author Michael Pavone <pavone@retrodev.com>
date Sun, 19 Apr 2020 00:59:09 -0700
parents 253c62b7144e
children 3dd9c68472fb
line wrap: on
line diff
--- a/nuklear_ui/font.c	Sat Apr 18 11:42:53 2020 -0700
+++ b/nuklear_ui/font.c	Sun Apr 19 00:59:09 2020 -0700
@@ -1,11 +1,19 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
+#include <string.h>
 #include "../util.h"
 #include "sfnt.h"
 
 char *default_font_path(void)
 {
+#ifdef FONT_PATH
+	FILE *f = fopen(FONT_PATH, "rb");
+	if (f) {
+		fclose(f);
+		return strdup(FONT_PATH);
+	}
+#endif
 	FILE *fc_pipe = popen("fc-match -f '%{file}'", "r");
 	if (!fc_pipe) {
 		return NULL;