From d6dbd39231a843e7b539a1f220db351340064136 Mon Sep 17 00:00:00 2001 From: Mark Kim Date: Sat, 10 Jun 2023 16:18:53 -0400 Subject: [PATCH] Set FONTCONFIG_PATH before --listfonts on macOS Also, search more system folders for fonts on macOS. --- macos/fonts.conf | 4 ++++ src/tuxpaint.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/macos/fonts.conf b/macos/fonts.conf index 0004ec172..6bee5970c 100644 --- a/macos/fonts.conf +++ b/macos/fonts.conf @@ -19,6 +19,10 @@ /Library/Application Support/TuxPaint/fonts /Library/Application Support/TuxPaint/fonts/locale + /Library/Fonts + /Network/Library/Fonts + /System/Library/Fonts + diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 420ed1773..6ed2e005c 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -30418,6 +30418,14 @@ int main(int argc, char *argv[]) printf("Tux Paint log - %s\n", logTime); #endif +#if defined(__MACOS__) + /* Pango uses Fontconfig which requires /opt/local/etc/fonts/fonts.conf. This + * file may not exist on the runtime system, however, so we copy the file + * into our app bundle at compile time, and tell Fontconfig here to look for + * the file within the app bundle. */ + putenv((char *)"FONTCONFIG_PATH=Resources/etc"); +#endif + chdir_to_binary(argv[0]); setup_config(argv); @@ -30436,14 +30444,6 @@ int main(int argc, char *argv[]) CLOCK_ASM(time2); #endif -#if defined(__MACOS__) - /* Pango uses Fontconfig which requires /opt/local/etc/fonts/fonts.conf. This - * file may not exist on the runtime system, however, so we copy the file - * into our app bundle at compile time, and tell Fontconfig here to look for - * the file within the app bundle. */ - putenv((char *)"FONTCONFIG_PATH=Resources/etc"); -#endif - #if defined(FC_DEBUG) /* * Enable fontconfig debugging. See "debug.h"