diff options
author | Michael Pavone <pavone@retrodev.com> | 2020-04-18 23:07:44 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2020-04-18 23:07:44 -0700 |
commit | 6f24fe6971e31837abecb3367967ddc8d8c103dd (patch) | |
tree | a31e7f37239c53b1a57a854cb02e1a490fb288e2 /nuklear_ui | |
parent | 897b2c899f7932e6ac4842765fd3a870f5201901 (diff) |
Allow specifying a default font path at build time
Diffstat (limited to 'nuklear_ui')
-rw-r--r-- | nuklear_ui/font.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nuklear_ui/font.c b/nuklear_ui/font.c index ff86847..8dde3d0 100644 --- a/nuklear_ui/font.c +++ b/nuklear_ui/font.c @@ -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; |