comparison 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
comparison
equal deleted inserted replaced
1692:5dacaef602a7 2053:3414a4423de1
1 #include <stdio.h> 1 #include <stdio.h>
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <stdint.h> 3 #include <stdint.h>
4 #include <string.h>
4 #include "../util.h" 5 #include "../util.h"
5 #include "sfnt.h" 6 #include "sfnt.h"
6 7
7 char *default_font_path(void) 8 char *default_font_path(void)
8 { 9 {
9 FILE *fc_pipe = popen("fc-match -f '%{file}'", "r"); 10 #ifdef FONT_PATH
11 FILE *f = fopen(FONT_PATH, "rb");
12 if (f) {
13 fclose(f);
14 return strdup(FONT_PATH);
15 }
16 #endif
17 //TODO: specify language dynamically once BlastEm is localized
18 FILE *fc_pipe = popen("fc-match :lang=en -f '%{file}'", "r");
10 if (!fc_pipe) { 19 if (!fc_pipe) {
11 return NULL; 20 return NULL;
12 } 21 }
13 size_t buf_size = 128; 22 size_t buf_size = 128;
14 char *buffer = NULL; 23 char *buffer = NULL;