diff --git a/assets/fonts/CJK/DroidSansFallback-Regular.tres b/assets/fonts/CJK/DroidSansFallback-Regular.tres deleted file mode 100644 index 489da1ee7..000000000 --- a/assets/fonts/CJK/DroidSansFallback-Regular.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] - -[ext_resource path="res://assets/fonts/CJK/DroidSansFallback.ttf" type="DynamicFontData" id=1] - -[resource] -size = 12 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 1 ) diff --git a/assets/fonts/CJK/DroidSansFallback-Small.tres b/assets/fonts/CJK/DroidSansFallback-Small.tres deleted file mode 100644 index 308d1c363..000000000 --- a/assets/fonts/CJK/DroidSansFallback-Small.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] - -[ext_resource path="res://assets/fonts/CJK/DroidSansFallback.ttf" type="DynamicFontData" id=1] - -[resource] -size = 10 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 1 ) diff --git a/assets/fonts/CJK/DroidSansFallback.ttf b/assets/fonts/DroidSansFallback.ttf similarity index 100% rename from assets/fonts/CJK/DroidSansFallback.ttf rename to assets/fonts/DroidSansFallback.ttf diff --git a/assets/fonts/Roboto-Bold.tres b/assets/fonts/Roboto-Bold.tres deleted file mode 100644 index 9a7ab6c54..000000000 --- a/assets/fonts/Roboto-Bold.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] - -[ext_resource path="res://assets/fonts/Roboto-Bold.ttf" type="DynamicFontData" id=1] - -[resource] -size = 12 -use_mipmaps = true -use_filter = true -font_data = ExtResource( 1 ) diff --git a/assets/fonts/Roboto-Bold.ttf b/assets/fonts/Roboto-Bold.ttf deleted file mode 100644 index d3f01ad24..000000000 Binary files a/assets/fonts/Roboto-Bold.ttf and /dev/null differ diff --git a/assets/fonts/Roboto-Italic.tres b/assets/fonts/Roboto-Italic.tres index 35c460ea4..b4fcaac7c 100644 --- a/assets/fonts/Roboto-Italic.tres +++ b/assets/fonts/Roboto-Italic.tres @@ -1,9 +1,11 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="DynamicFont" load_steps=3 format=2] [ext_resource path="res://assets/fonts/Roboto-Italic.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/fonts/DroidSansFallback.ttf" type="DynamicFontData" id=2] [resource] size = 12 use_mipmaps = true use_filter = true font_data = ExtResource( 1 ) +fallback/0 = ExtResource( 2 ) diff --git a/assets/fonts/Roboto-Regular.tres b/assets/fonts/Roboto-Regular.tres index 57a064762..d8e5b485e 100644 --- a/assets/fonts/Roboto-Regular.tres +++ b/assets/fonts/Roboto-Regular.tres @@ -1,9 +1,11 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="DynamicFont" load_steps=3 format=2] [ext_resource path="res://assets/fonts/Roboto-Regular.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/fonts/DroidSansFallback.ttf" type="DynamicFontData" id=2] [resource] size = 12 use_mipmaps = true use_filter = true font_data = ExtResource( 1 ) +fallback/0 = ExtResource( 2 ) diff --git a/assets/fonts/Roboto-Small.tres b/assets/fonts/Roboto-Small.tres index bdc67bb8d..c4d999cae 100644 --- a/assets/fonts/Roboto-Small.tres +++ b/assets/fonts/Roboto-Small.tres @@ -1,8 +1,10 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] +[gd_resource type="DynamicFont" load_steps=3 format=2] [ext_resource path="res://assets/fonts/Roboto-Regular.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://assets/fonts/DroidSansFallback.ttf" type="DynamicFontData" id=2] [resource] size = 10 use_mipmaps = true font_data = ExtResource( 1 ) +fallback/0 = ExtResource( 2 ) diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 22d0c6c7a..e3a101d20 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -327,7 +327,3 @@ func update_hint_tooltips() -> void: for tip in ui_tooltips: tip.hint_tooltip = tr(ui_tooltips[tip]) % tip.shortcut.get_as_text() - - -func is_cjk(locale: String) -> bool: - return "zh" in locale or "ko" in locale or "ja" in locale diff --git a/src/Preferences/HandleLanguages.gd b/src/Preferences/HandleLanguages.gd index d36e11717..fe4c594b9 100644 --- a/src/Preferences/HandleLanguages.gd +++ b/src/Preferences/HandleLanguages.gd @@ -26,8 +26,6 @@ const LANGUAGES_DICT := { } var loaded_locales: Array -onready var latin_font = preload("res://assets/fonts/Roboto-Regular.tres") -onready var cjk_font = preload("res://assets/fonts/CJK/DroidSansFallback-Regular.tres") func _ready() -> void: @@ -47,10 +45,6 @@ func _ready() -> void: button.hint_tooltip = LANGUAGES_DICT[locale][1] button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND button.group = button_group - if Global.is_cjk(locale): - button.add_font_override("font", cjk_font) - else: - button.add_font_override("font", latin_font) add_child(button) # Load language @@ -65,11 +59,6 @@ func _ready() -> void: else: # If the user doesn't have a language preference, set it to their OS' locale TranslationServer.set_locale(OS.get_locale()) - if Global.is_cjk(TranslationServer.get_locale()): - Global.control.theme.default_font = cjk_font - else: - Global.control.theme.default_font = latin_font - for child in get_children(): if child is Button: child.connect("pressed", self, "_on_Language_pressed", [child.get_index()]) @@ -83,11 +72,6 @@ func _on_Language_pressed(index: int) -> void: else: TranslationServer.set_locale(loaded_locales[index - 1]) - if Global.is_cjk(TranslationServer.get_locale()): - Global.control.theme.default_font = cjk_font - else: - Global.control.theme.default_font = latin_font - Global.config_cache.set_value("preferences", "locale", TranslationServer.get_locale()) Global.config_cache.save("user://cache.ini") diff --git a/src/UI/Dialogs/AboutDialog.gd b/src/UI/Dialogs/AboutDialog.gd index ac98ed901..cb730e464 100644 --- a/src/UI/Dialogs/AboutDialog.gd +++ b/src/UI/Dialogs/AboutDialog.gd @@ -20,11 +20,6 @@ onready var license_text: TextEdit = $AboutUI/Credits/Licenses/LicenseText onready var slogan: Label = $AboutUI/IconsButtons/SloganAndLinks/VBoxContainer/PixeloramaSlogan onready var copyright_label: Label = $AboutUI/Copyright -onready var latin_font_italic = preload("res://assets/fonts/Roboto-Italic.tres") -onready var cjk_font = preload("res://assets/fonts/CJK/DroidSansFallback-Regular.tres") -onready var latin_font_small = preload("res://assets/fonts/Roboto-Small.tres") -onready var cjk_font_small = preload("res://assets/fonts/CJK/DroidSansFallback-Small.tres") - func _ready() -> void: create_donors() @@ -38,13 +33,6 @@ func _ready() -> void: func _on_AboutDialog_about_to_show() -> void: window_title = tr("About Pixelorama") + " " + Global.current_version - if Global.is_cjk(TranslationServer.get_locale()): - slogan.add_font_override("font", cjk_font) - copyright_label.add_font_override("font", cjk_font_small) - else: - slogan.add_font_override("font", latin_font_italic) - copyright_label.add_font_override("font", latin_font_small) - var groups_root := groups.create_item() var developers_button := groups.create_item(groups_root) var contributors_button := groups.create_item(groups_root) diff --git a/src/UI/Dialogs/SplashDialog.gd b/src/UI/Dialogs/SplashDialog.gd index 9079ea93b..c440cf16f 100644 --- a/src/UI/Dialogs/SplashDialog.gd +++ b/src/UI/Dialogs/SplashDialog.gd @@ -23,15 +23,11 @@ var chosen_artwork: int var splash_art_texturerect: TextureRect var art_by_label: Button -onready var latin_font = preload("res://assets/fonts/Roboto-Small.tres") -onready var cjk_font = preload("res://assets/fonts/CJK/DroidSansFallback-Small.tres") - func _on_SplashDialog_about_to_show() -> void: splash_art_texturerect = find_node("SplashArt") art_by_label = find_node("ArtistName") var show_on_startup_button: CheckBox = find_node("ShowOnStartup") - var copyright_label: Label = find_node("CopyrightLabel") if Global.config_cache.has_section_key("preferences", "startup"): show_on_startup_button.pressed = !Global.config_cache.get_value("preferences", "startup") @@ -40,13 +36,6 @@ func _on_SplashDialog_about_to_show() -> void: chosen_artwork = randi() % artworks.size() change_artwork(0) - if Global.is_cjk(TranslationServer.get_locale()): - show_on_startup_button.add_font_override("font", cjk_font) - copyright_label.add_font_override("font", cjk_font) - else: - show_on_startup_button.add_font_override("font", latin_font) - copyright_label.add_font_override("font", latin_font) - get_stylebox("panel", "WindowDialog").bg_color = Global.control.theme.get_stylebox( "panel", "WindowDialog" ).bg_color