From ab255caa07f34cc8212f4cdd2390d9257a657095 Mon Sep 17 00:00:00 2001 From: Voylin <0voylin0@gmail.com> Date: Sun, 11 Sep 2022 16:16:43 +0900 Subject: Adding tff, otf, woff(2) to custom font extensions This pull request is to fix #65633 When trying to add a custom font, my '.ttf' and '.otf' fonts were not visible unless I selected 'All files'. By adding these to the custom property info makes it more convenient to select a different font, without doing the extra clicks to select 'All Files'. Not a big change, but something I wanted to fix as it seems appropriate to do so. --- scene/theme/theme_db.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/theme') diff --git a/scene/theme/theme_db.cpp b/scene/theme/theme_db.cpp index d6e892cd93..71d9b9d58a 100644 --- a/scene/theme/theme_db.cpp +++ b/scene/theme/theme_db.cpp @@ -49,7 +49,7 @@ void ThemeDB::initialize_theme() { ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); String font_path = GLOBAL_DEF_RST("gui/theme/custom_font", ""); - ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); + ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.otf,*.ttf,*.woff,*.woff2,*.fnt,*.font,*.pfb,*.pfm", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); TextServer::FontAntialiasing font_antialiasing = (TextServer::FontAntialiasing)(int)GLOBAL_DEF_RST("gui/theme/default_font_antialiasing", 1); ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/default_font_antialiasing", PropertyInfo(Variant::INT, "gui/theme/default_font_antialiasing", PROPERTY_HINT_ENUM, "None,Grayscale,LCD sub-pixel", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); -- cgit v1.2.3