From 58f63ae4a77ff691555f3397263b9d908b6d4456 Mon Sep 17 00:00:00 2001 From: Maksym H Date: Mon, 5 Jun 2023 15:26:53 +0300 Subject: [PATCH] Apple: switch to MultiCraft Font --- Apple/scripts/assets.sh | 2 +- Apple/scripts/locale.sh | 2 +- src/defaultsettings.cpp | 28 ++++++++-------------------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Apple/scripts/assets.sh b/Apple/scripts/assets.sh index 1a21eea3a..72cd3d31d 100755 --- a/Apple/scripts/assets.sh +++ b/Apple/scripts/assets.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -ALL_FONTS=true +ALL_FONTS=false if [ ! -d MultiCraft/MultiCraft.xcodeproj ]; then echo "Run this from Apple folder" diff --git a/Apple/scripts/locale.sh b/Apple/scripts/locale.sh index 01d7fd8b6..bc61a6fae 100755 --- a/Apple/scripts/locale.sh +++ b/Apple/scripts/locale.sh @@ -24,6 +24,6 @@ popd find $DEST -type d,f -name '.*' -print0 | xargs -0 -- rm -rf # remove broken languages -for broken_lang in ar he hi ky ms_Arab th; do +for broken_lang in dv eo he hi kn ko ms_Arab nn pt_BR sr_* th zh_*; do rm -rf $DEST/$broken_lang done diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 11283ff0e..5b4216fe8 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -303,46 +303,34 @@ void set_default_settings() #if USE_FREETYPE settings->setDefault("freetype", "true"); + std::string MultiCraftFont = porting::getDataPath("fonts" DIR_DELIM "MultiCraftFont.ttf"); + #if !defined(__ANDROID__) && !defined(__APPLE__) settings->setDefault("font_path", porting::getDataPath("fonts" DIR_DELIM "Arimo-Regular.ttf")); settings->setDefault("font_path_italic", porting::getDataPath("fonts" DIR_DELIM "Arimo-Italic.ttf")); settings->setDefault("font_path_bold", porting::getDataPath("fonts" DIR_DELIM "Arimo-Bold.ttf")); settings->setDefault("font_path_bold_italic", porting::getDataPath("fonts" DIR_DELIM "Arimo-BoldItalic.ttf")); #else - std::string MultiCraftFont = porting::getDataPath("fonts" DIR_DELIM "MultiCraftFont.ttf"); settings->setDefault("font_path", MultiCraftFont); settings->setDefault("font_path_italic", MultiCraftFont); settings->setDefault("font_path_bold", MultiCraftFont); settings->setDefault("font_path_bold_italic", MultiCraftFont); #endif + settings->setDefault("font_bold", "false"); settings->setDefault("font_italic", "false"); settings->setDefault("font_shadow", "1"); settings->setDefault("font_shadow_alpha", "127"); -#if !defined(__ANDROID__) && !defined(__IOS__) - settings->setDefault("mono_font_path", porting::getDataPath("fonts" DIR_DELIM "Cousine-Regular.ttf")); - settings->setDefault("mono_font_path_italic", porting::getDataPath("fonts" DIR_DELIM "Cousine-Italic.ttf")); - settings->setDefault("mono_font_path_bold", porting::getDataPath("fonts" DIR_DELIM "Cousine-Bold.ttf")); - settings->setDefault("mono_font_path_bold_italic", porting::getDataPath("fonts" DIR_DELIM "Cousine-BoldItalic.ttf")); - settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf")); -#else -#ifdef __ANDROID__ - settings->setDefault("mono_font_path", "/system/fonts/DroidSansMono.ttf"); - settings->setDefault("mono_font_path_italic", "/system/fonts/DroidSansMono.ttf"); - settings->setDefault("mono_font_path_bold", "/system/fonts/DroidSansMono.ttf"); - settings->setDefault("mono_font_path_bold_italic", "/system/fonts/DroidSansMono.ttf"); - if (android_get_device_api_level() >= __ANDROID_API_N__) - settings->setDefault("fallback_font_path", "/system/fonts/NotoSansCJK-Regular.ttc"); - else - settings->setDefault("fallback_font_path", "/system/fonts/DroidSans.ttf"); -#endif -#ifdef __IOS__ + settings->setDefault("mono_font_path", MultiCraftFont); settings->setDefault("mono_font_path_italic", MultiCraftFont); settings->setDefault("mono_font_path_bold", MultiCraftFont); settings->setDefault("mono_font_path_bold_italic", MultiCraftFont); + +#if !defined(__ANDROID__) && !defined(__APPLE__) + settings->setDefault("fallback_font_path", porting::getDataPath("fonts" DIR_DELIM "DroidSansFallbackFull.ttf")); +#else settings->setDefault("fallback_font_path", MultiCraftFont); -#endif #endif settings->setDefault("fallback_font_shadow", "1");