macOS check for locale fonts in Tux Paint system preferences location

This commit is contained in:
Mark Kim 2022-02-12 22:13:26 -05:00
parent 5330fea44c
commit 2cc4217a0c

View file

@ -960,6 +960,8 @@ static void loadfonts_locale_filter(SDL_Surface * screen, const char *const dir,
char buf[TP_FTW_PATHSIZE];
unsigned dirlen = strlen(dir);
DEBUG_PRINTF("Loading fonts from [%s]\n", dir);
memcpy(buf, dir, dirlen);
tp_ftw(screen, buf, dirlen, 1, loadfont_callback, locale);
}
@ -1034,6 +1036,15 @@ static void loadfonts(SDL_Surface * screen, const char *const dir)
free(homedirdir);
#endif
#ifdef __APPLE__
homedirdir = malloc(snprintf(NULL, 0, "%s/fonts", apple_globalPreferencesPath()) + 1);
if(homedirdir) {
sprintf(homedirdir, "%s/fonts", apple_globalPreferencesPath());
loadfonts(screen, homedirdir);
free(homedirdir);
}
#endif
#ifdef DEBUG
printf("%s:%d - Grouping %d fonts...\n", __FILE__, __LINE__, num_font_styles);
fflush(stdout);