Mercurial > repos > blastem
diff nuklear_ui/font.c @ 2053:3414a4423de1 segacd
Merge from default
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 15 Jan 2022 13:15:21 -0800 |
parents | 3dd9c68472fb |
children | 369a52e302e2 |
line wrap: on
line diff
--- a/nuklear_ui/font.c Sat Jan 05 00:58:08 2019 -0800 +++ b/nuklear_ui/font.c Sat Jan 15 13:15:21 2022 -0800 @@ -1,12 +1,21 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> +#include <string.h> #include "../util.h" #include "sfnt.h" char *default_font_path(void) { - FILE *fc_pipe = popen("fc-match -f '%{file}'", "r"); +#ifdef FONT_PATH + FILE *f = fopen(FONT_PATH, "rb"); + if (f) { + fclose(f); + return strdup(FONT_PATH); + } +#endif + //TODO: specify language dynamically once BlastEm is localized + FILE *fc_pipe = popen("fc-match :lang=en -f '%{file}'", "r"); if (!fc_pipe) { return NULL; }