macOS check for locale fonts in Tux Paint system preferences location
This commit is contained in:
parent
5330fea44c
commit
2cc4217a0c
1 changed files with 11 additions and 0 deletions
11
src/fonts.c
11
src/fonts.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue