diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index a9edfac7a1f..882545c5473 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -166,17 +166,17 @@ Comment: etcpak Copyright: 2013-2021, Bartosz Taudul License: BSD-3-clause -Files: ./thirdparty/fonts/DroidSans*.ttf +Files: ./thirdparty/fonts/DroidSans*.woff2 Comment: DroidSans font Copyright: 2008, The Android Open Source Project License: Apache-2.0 -Files: ./thirdparty/fonts/JetBrainsMono_Regular.ttf +Files: ./thirdparty/fonts/JetBrainsMono_Regular.woff2 Comment: JetBrains Mono font Copyright: 2020, JetBrains s.r.o. License: OFL-1.1 -Files: ./thirdparty/fonts/NotoSans*.ttf +Files: ./thirdparty/fonts/NotoSans*.woff2 Comment: Noto Sans font Copyright: 2012, Google Inc. License: OFL-1.1 diff --git a/editor/SCsub b/editor/SCsub index 35c215b6639..5dcc253e8bd 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -99,6 +99,8 @@ if env["tools"]: # Fonts flist = glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.ttf") flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.otf")) + flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff")) + flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff2")) flist.sort() env.Depends("#editor/builtin_fonts.gen.h", flist) env.CommandNoCache( diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 08cc957ec74..5057fc75316 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -422,9 +422,9 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { #endif EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/font_subpixel_positioning", 1, "Disabled,Auto,One half of a pixel,One quarter of a pixel") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/main_font", "", "*.ttf,*.otf") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/main_font_bold", "", "*.ttf,*.otf") - EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/code_font", "", "*.ttf,*.otf") + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/main_font", "", "*.ttf,*.otf,*.woff,*.woff2,*.pfb,*.pfm") + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/main_font_bold", "", "*.ttf,*.otf,*.woff,*.woff2,*.pfb,*.pfm") + EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "interface/editor/code_font", "", "*.ttf,*.otf,*.woff,*.woff2,*.pfb,*.pfm") EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "interface/editor/low_processor_mode_sleep_usec", 6900, "1,100000,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) // Default unfocused usec sleep is for 10 FPS. Allow an unfocused FPS limit // as low as 1 FPS for those who really need low power usage (but don't need diff --git a/scene/resources/default_theme/SCsub b/scene/resources/default_theme/SCsub index f27bd9144e4..5bef7e5a6c5 100644 --- a/scene/resources/default_theme/SCsub +++ b/scene/resources/default_theme/SCsub @@ -8,10 +8,10 @@ import default_theme_icons_builders env.add_source_files(env.scene_sources, "*.cpp") -env.Depends("#scene/resources/default_theme/default_font.gen.h", "#thirdparty/fonts/OpenSans_SemiBold.ttf") +env.Depends("#scene/resources/default_theme/default_font.gen.h", "#thirdparty/fonts/OpenSans_SemiBold.woff2") env.CommandNoCache( "#scene/resources/default_theme/default_font.gen.h", - "#thirdparty/fonts/OpenSans_SemiBold.ttf", + "#thirdparty/fonts/OpenSans_SemiBold.woff2", run_in_subprocess(default_theme_builders.make_fonts_header), ) diff --git a/thirdparty/README.md b/thirdparty/README.md index 2b90fb16575..f976e6ea799 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -130,25 +130,25 @@ Files extracted from upstream source: ## fonts -- `NotoSans*.ttf`, `NotoNaskhArabicUI_*.ttf`: +- `NotoSans*.woff2`, `NotoNaskhArabicUI_*.woff2`: * Upstream: https://github.com/googlefonts/noto-fonts * Version: v2017-10-24-phase3-second-cleanup * License: OFL-1.1 * Comment: Use UI font variant if available, because it has tight vertical metrics and good for UI. -- `JetBrainsMono_Regular.ttf`: +- `JetBrainsMono_Regular.woff2`: * Upstream: https://github.com/JetBrains/JetBrainsMono * Version: 2.242 * License: OFL-1.1 -- `DroidSans*.ttf`: +- `DroidSans*.woff2`: * Upstream: https://android.googlesource.com/platform/frameworks/base/+/master/data/fonts/ * Version: ? (pre-2014 commit when DroidSansJapanese.ttf was obsoleted) * License: Apache 2.0 -- `OpenSans_SemiBold.ttf`: +- `OpenSans_SemiBold.woff2`: * Upstream: https://fonts.google.com/specimen/Open+Sans * Version: 1.10 (downloaded from Google Fonts in February 2021) * License: Apache 2.0 - +- All fonts are converted from the `.ttf` sources using `https://github.com/google/woff2` tool. ## freetype diff --git a/thirdparty/fonts/DroidSansFallback.ttf b/thirdparty/fonts/DroidSansFallback.ttf deleted file mode 100644 index 206621fc6cf..00000000000 Binary files a/thirdparty/fonts/DroidSansFallback.ttf and /dev/null differ diff --git a/thirdparty/fonts/DroidSansFallback.woff2 b/thirdparty/fonts/DroidSansFallback.woff2 new file mode 100644 index 00000000000..9dd49d6281c Binary files /dev/null and b/thirdparty/fonts/DroidSansFallback.woff2 differ diff --git a/thirdparty/fonts/DroidSansJapanese.ttf b/thirdparty/fonts/DroidSansJapanese.ttf deleted file mode 100644 index 412fa3de05e..00000000000 Binary files a/thirdparty/fonts/DroidSansJapanese.ttf and /dev/null differ diff --git a/thirdparty/fonts/DroidSansJapanese.woff2 b/thirdparty/fonts/DroidSansJapanese.woff2 new file mode 100644 index 00000000000..96eaf5ce72e Binary files /dev/null and b/thirdparty/fonts/DroidSansJapanese.woff2 differ diff --git a/thirdparty/fonts/JetBrainsMono_Regular.ttf b/thirdparty/fonts/JetBrainsMono_Regular.ttf deleted file mode 100644 index 8da8aa40513..00000000000 Binary files a/thirdparty/fonts/JetBrainsMono_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/JetBrainsMono_Regular.woff2 b/thirdparty/fonts/JetBrainsMono_Regular.woff2 new file mode 100644 index 00000000000..490104645bc Binary files /dev/null and b/thirdparty/fonts/JetBrainsMono_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoNaskhArabicUI_Bold.ttf b/thirdparty/fonts/NotoNaskhArabicUI_Bold.ttf deleted file mode 100644 index 5576af7fee7..00000000000 Binary files a/thirdparty/fonts/NotoNaskhArabicUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoNaskhArabicUI_Bold.woff2 b/thirdparty/fonts/NotoNaskhArabicUI_Bold.woff2 new file mode 100644 index 00000000000..72358d6eb10 Binary files /dev/null and b/thirdparty/fonts/NotoNaskhArabicUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoNaskhArabicUI_Regular.ttf b/thirdparty/fonts/NotoNaskhArabicUI_Regular.ttf deleted file mode 100644 index 9b7a93d1362..00000000000 Binary files a/thirdparty/fonts/NotoNaskhArabicUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoNaskhArabicUI_Regular.woff2 b/thirdparty/fonts/NotoNaskhArabicUI_Regular.woff2 new file mode 100644 index 00000000000..1195d4174ea Binary files /dev/null and b/thirdparty/fonts/NotoNaskhArabicUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansBengaliUI_Bold.ttf b/thirdparty/fonts/NotoSansBengaliUI_Bold.ttf deleted file mode 100644 index dc61efefd56..00000000000 Binary files a/thirdparty/fonts/NotoSansBengaliUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansBengaliUI_Bold.woff2 b/thirdparty/fonts/NotoSansBengaliUI_Bold.woff2 new file mode 100644 index 00000000000..03adf85fdcd Binary files /dev/null and b/thirdparty/fonts/NotoSansBengaliUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansBengaliUI_Regular.ttf b/thirdparty/fonts/NotoSansBengaliUI_Regular.ttf deleted file mode 100644 index d43c292ad6c..00000000000 Binary files a/thirdparty/fonts/NotoSansBengaliUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansBengaliUI_Regular.woff2 b/thirdparty/fonts/NotoSansBengaliUI_Regular.woff2 new file mode 100644 index 00000000000..a6a3ffa3a72 Binary files /dev/null and b/thirdparty/fonts/NotoSansBengaliUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansDevanagariUI_Bold.ttf b/thirdparty/fonts/NotoSansDevanagariUI_Bold.ttf deleted file mode 100644 index 74791aa469f..00000000000 Binary files a/thirdparty/fonts/NotoSansDevanagariUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansDevanagariUI_Bold.woff2 b/thirdparty/fonts/NotoSansDevanagariUI_Bold.woff2 new file mode 100644 index 00000000000..6c835712cb1 Binary files /dev/null and b/thirdparty/fonts/NotoSansDevanagariUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansDevanagariUI_Regular.ttf b/thirdparty/fonts/NotoSansDevanagariUI_Regular.ttf deleted file mode 100644 index e48dced0c9c..00000000000 Binary files a/thirdparty/fonts/NotoSansDevanagariUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansDevanagariUI_Regular.woff2 b/thirdparty/fonts/NotoSansDevanagariUI_Regular.woff2 new file mode 100644 index 00000000000..486896e6e95 Binary files /dev/null and b/thirdparty/fonts/NotoSansDevanagariUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansGeorgian_Bold.ttf b/thirdparty/fonts/NotoSansGeorgian_Bold.ttf deleted file mode 100644 index 5443d04cfa7..00000000000 Binary files a/thirdparty/fonts/NotoSansGeorgian_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansGeorgian_Bold.woff2 b/thirdparty/fonts/NotoSansGeorgian_Bold.woff2 new file mode 100644 index 00000000000..104afa150ce Binary files /dev/null and b/thirdparty/fonts/NotoSansGeorgian_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansGeorgian_Regular.ttf b/thirdparty/fonts/NotoSansGeorgian_Regular.ttf deleted file mode 100644 index 9bfc8d9675b..00000000000 Binary files a/thirdparty/fonts/NotoSansGeorgian_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansGeorgian_Regular.woff2 b/thirdparty/fonts/NotoSansGeorgian_Regular.woff2 new file mode 100644 index 00000000000..0a7b9e878b8 Binary files /dev/null and b/thirdparty/fonts/NotoSansGeorgian_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansHebrew_Bold.ttf b/thirdparty/fonts/NotoSansHebrew_Bold.ttf deleted file mode 100644 index 08ef5dc749b..00000000000 Binary files a/thirdparty/fonts/NotoSansHebrew_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansHebrew_Bold.woff2 b/thirdparty/fonts/NotoSansHebrew_Bold.woff2 new file mode 100644 index 00000000000..96c5ae1349b Binary files /dev/null and b/thirdparty/fonts/NotoSansHebrew_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansHebrew_Regular.ttf b/thirdparty/fonts/NotoSansHebrew_Regular.ttf deleted file mode 100644 index 0a89e9d21f8..00000000000 Binary files a/thirdparty/fonts/NotoSansHebrew_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansHebrew_Regular.woff2 b/thirdparty/fonts/NotoSansHebrew_Regular.woff2 new file mode 100644 index 00000000000..17eadedc6f7 Binary files /dev/null and b/thirdparty/fonts/NotoSansHebrew_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansMalayalamUI_Bold.ttf b/thirdparty/fonts/NotoSansMalayalamUI_Bold.ttf deleted file mode 100644 index 42e5d56f3f6..00000000000 Binary files a/thirdparty/fonts/NotoSansMalayalamUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansMalayalamUI_Bold.woff2 b/thirdparty/fonts/NotoSansMalayalamUI_Bold.woff2 new file mode 100644 index 00000000000..5f6bacb0c32 Binary files /dev/null and b/thirdparty/fonts/NotoSansMalayalamUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansMalayalamUI_Regular.ttf b/thirdparty/fonts/NotoSansMalayalamUI_Regular.ttf deleted file mode 100644 index 37f3591706c..00000000000 Binary files a/thirdparty/fonts/NotoSansMalayalamUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansMalayalamUI_Regular.woff2 b/thirdparty/fonts/NotoSansMalayalamUI_Regular.woff2 new file mode 100644 index 00000000000..c54a82a874c Binary files /dev/null and b/thirdparty/fonts/NotoSansMalayalamUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansOriyaUI_Bold.ttf b/thirdparty/fonts/NotoSansOriyaUI_Bold.ttf deleted file mode 100644 index 36323f79ef2..00000000000 Binary files a/thirdparty/fonts/NotoSansOriyaUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansOriyaUI_Bold.woff2 b/thirdparty/fonts/NotoSansOriyaUI_Bold.woff2 new file mode 100644 index 00000000000..b7e34302e29 Binary files /dev/null and b/thirdparty/fonts/NotoSansOriyaUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansOriyaUI_Regular.ttf b/thirdparty/fonts/NotoSansOriyaUI_Regular.ttf deleted file mode 100644 index 7b50a716209..00000000000 Binary files a/thirdparty/fonts/NotoSansOriyaUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansOriyaUI_Regular.woff2 b/thirdparty/fonts/NotoSansOriyaUI_Regular.woff2 new file mode 100644 index 00000000000..e64090cd775 Binary files /dev/null and b/thirdparty/fonts/NotoSansOriyaUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansSinhalaUI_Bold.ttf b/thirdparty/fonts/NotoSansSinhalaUI_Bold.ttf deleted file mode 100644 index ecfff97e05c..00000000000 Binary files a/thirdparty/fonts/NotoSansSinhalaUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansSinhalaUI_Bold.woff2 b/thirdparty/fonts/NotoSansSinhalaUI_Bold.woff2 new file mode 100644 index 00000000000..01dbd1bc8f8 Binary files /dev/null and b/thirdparty/fonts/NotoSansSinhalaUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansSinhalaUI_Regular.ttf b/thirdparty/fonts/NotoSansSinhalaUI_Regular.ttf deleted file mode 100644 index a4b297d6910..00000000000 Binary files a/thirdparty/fonts/NotoSansSinhalaUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansSinhalaUI_Regular.woff2 b/thirdparty/fonts/NotoSansSinhalaUI_Regular.woff2 new file mode 100644 index 00000000000..504c9d08091 Binary files /dev/null and b/thirdparty/fonts/NotoSansSinhalaUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansTamilUI_Bold.ttf b/thirdparty/fonts/NotoSansTamilUI_Bold.ttf deleted file mode 100644 index 16bcd57081f..00000000000 Binary files a/thirdparty/fonts/NotoSansTamilUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansTamilUI_Bold.woff2 b/thirdparty/fonts/NotoSansTamilUI_Bold.woff2 new file mode 100644 index 00000000000..96967b0cceb Binary files /dev/null and b/thirdparty/fonts/NotoSansTamilUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansTamilUI_Regular.ttf b/thirdparty/fonts/NotoSansTamilUI_Regular.ttf deleted file mode 100644 index e65aeb8d0ba..00000000000 Binary files a/thirdparty/fonts/NotoSansTamilUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansTamilUI_Regular.woff2 b/thirdparty/fonts/NotoSansTamilUI_Regular.woff2 new file mode 100644 index 00000000000..e9b2bee5824 Binary files /dev/null and b/thirdparty/fonts/NotoSansTamilUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansTeluguUI_Bold.ttf b/thirdparty/fonts/NotoSansTeluguUI_Bold.ttf deleted file mode 100644 index 16ac368795a..00000000000 Binary files a/thirdparty/fonts/NotoSansTeluguUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansTeluguUI_Bold.woff2 b/thirdparty/fonts/NotoSansTeluguUI_Bold.woff2 new file mode 100644 index 00000000000..2885bf991d0 Binary files /dev/null and b/thirdparty/fonts/NotoSansTeluguUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansTeluguUI_Regular.ttf b/thirdparty/fonts/NotoSansTeluguUI_Regular.ttf deleted file mode 100644 index 5394a28cfe3..00000000000 Binary files a/thirdparty/fonts/NotoSansTeluguUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansTeluguUI_Regular.woff2 b/thirdparty/fonts/NotoSansTeluguUI_Regular.woff2 new file mode 100644 index 00000000000..ac5e66d8f63 Binary files /dev/null and b/thirdparty/fonts/NotoSansTeluguUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSansThaiUI_Bold.ttf b/thirdparty/fonts/NotoSansThaiUI_Bold.ttf deleted file mode 100644 index 5d998f9215e..00000000000 Binary files a/thirdparty/fonts/NotoSansThaiUI_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansThaiUI_Bold.woff2 b/thirdparty/fonts/NotoSansThaiUI_Bold.woff2 new file mode 100644 index 00000000000..202995c0666 Binary files /dev/null and b/thirdparty/fonts/NotoSansThaiUI_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSansThaiUI_Regular.ttf b/thirdparty/fonts/NotoSansThaiUI_Regular.ttf deleted file mode 100644 index 8e317961d10..00000000000 Binary files a/thirdparty/fonts/NotoSansThaiUI_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSansThaiUI_Regular.woff2 b/thirdparty/fonts/NotoSansThaiUI_Regular.woff2 new file mode 100644 index 00000000000..2fb284f21fa Binary files /dev/null and b/thirdparty/fonts/NotoSansThaiUI_Regular.woff2 differ diff --git a/thirdparty/fonts/NotoSans_Bold.ttf b/thirdparty/fonts/NotoSans_Bold.ttf deleted file mode 100644 index 1db7886e948..00000000000 Binary files a/thirdparty/fonts/NotoSans_Bold.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSans_Bold.woff2 b/thirdparty/fonts/NotoSans_Bold.woff2 new file mode 100644 index 00000000000..36a5b899990 Binary files /dev/null and b/thirdparty/fonts/NotoSans_Bold.woff2 differ diff --git a/thirdparty/fonts/NotoSans_Regular.ttf b/thirdparty/fonts/NotoSans_Regular.ttf deleted file mode 100644 index 0a01a062f01..00000000000 Binary files a/thirdparty/fonts/NotoSans_Regular.ttf and /dev/null differ diff --git a/thirdparty/fonts/NotoSans_Regular.woff2 b/thirdparty/fonts/NotoSans_Regular.woff2 new file mode 100644 index 00000000000..d449eed8d77 Binary files /dev/null and b/thirdparty/fonts/NotoSans_Regular.woff2 differ diff --git a/thirdparty/fonts/OpenSans_SemiBold.ttf b/thirdparty/fonts/OpenSans_SemiBold.ttf deleted file mode 100644 index 54e7059cf36..00000000000 Binary files a/thirdparty/fonts/OpenSans_SemiBold.ttf and /dev/null differ diff --git a/thirdparty/fonts/OpenSans_SemiBold.woff2 b/thirdparty/fonts/OpenSans_SemiBold.woff2 new file mode 100644 index 00000000000..5d14a366569 Binary files /dev/null and b/thirdparty/fonts/OpenSans_SemiBold.woff2 differ