From 0b28bf49e4477487156b12bf4fec1869d9da0552 Mon Sep 17 00:00:00 2001 From: Mark Kim Date: Sun, 29 Dec 2024 17:37:59 -0500 Subject: [PATCH] Minor macOS documentation corrections --- docs/CHANGES.txt | 2 +- src/tuxpaint.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 7aba8df0f..9f8a4c516 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -34,7 +34,7 @@ https://tuxpaint.org/ + WIP Checking for fonts in any locations specified by "" entries found in system-wide and user-level FontConfig config files. This allows more fonts, and user-specific fonts, to be found & loaded. - - TODO - Looks in $FONTCONFIG/fonts.conf on macOS, otherwise + - TODO - Looks in $FONTCONFIG_PATH/fonts.conf on macOS/iOS, otherwise Un*x-specific `/etc/fonts/fonts.conf` and `~/.config/fontconfig/fonts.conf`. Should look in the correct places on other platforms. diff --git a/src/tuxpaint.c b/src/tuxpaint.c index babdab468..31c6617da 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -31100,11 +31100,17 @@ int main(int argc, char *argv[]) #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. */ + /* Pango uses Fontconfig which requires fonts.conf. By default, Fontconfig + * searches for this file in a global path (e.g., /opt/local/etc/fonts if + * using the MacPorts port of Fontconfig) which does not exist on a vanilla + * macOS install. As a workaround, the macOS port of Tux Paint provides its + * own copy, and tells Fontconfig to look inside the Tux Paint app bundle for + * this file by setting the FONTCONFIG_PATH environment variable here. + */ putenv((char *)"FONTCONFIG_PATH=Resources/etc"); +#elif defined(__IOS__) + /* Same with iOS */ + putenv((char *)"FONTCONFIG_PATH=etc"); #endif chdir_to_binary(argv[0]);