mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:34:43 -04:00
Changed CJK font and fixed some character issues
- The CJK font (for Chinese & Korean) was changed to DroidSansFallback from NotoSansCJKtc. This results in a much smaller exported `.pck` (over 10MB less) - Fixed Chinese and Korean characters not displaying properly in the Splash dialog and the About dialog.
This commit is contained in:
parent
4e14c999d3
commit
0d5b4416a4
11 changed files with 44 additions and 22 deletions
|
@ -24,7 +24,8 @@ const languages_dict := {
|
|||
}
|
||||
|
||||
var loaded_locales : Array
|
||||
onready var cjk_font = preload("res://assets/fonts/CJK/NotoSansCJKtc-Regular.tres")
|
||||
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:
|
||||
|
@ -44,8 +45,10 @@ func _ready() -> void:
|
|||
button.hint_tooltip = languages_dict[locale][1]
|
||||
button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
|
||||
button.group = button_group
|
||||
if is_cjk(locale):
|
||||
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
|
||||
|
@ -60,10 +63,10 @@ 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 is_cjk(TranslationServer.get_locale()):
|
||||
Global.control.theme.default_font = preload("res://assets/fonts/CJK/NotoSansCJKtc-Regular.tres")
|
||||
if Global.is_cjk(TranslationServer.get_locale()):
|
||||
Global.control.theme.default_font = cjk_font
|
||||
else:
|
||||
Global.control.theme.default_font = preload("res://assets/fonts/Roboto-Regular.tres")
|
||||
Global.control.theme.default_font = latin_font
|
||||
|
||||
for child in get_children():
|
||||
if child is Button:
|
||||
|
@ -78,10 +81,10 @@ func _on_Language_pressed(index : int) -> void:
|
|||
else:
|
||||
TranslationServer.set_locale(loaded_locales[index - 1])
|
||||
|
||||
if is_cjk(TranslationServer.get_locale()):
|
||||
Global.control.theme.default_font = preload("res://assets/fonts/CJK/NotoSansCJKtc-Regular.tres")
|
||||
if Global.is_cjk(TranslationServer.get_locale()):
|
||||
Global.control.theme.default_font = cjk_font
|
||||
else:
|
||||
Global.control.theme.default_font = preload("res://assets/fonts/Roboto-Regular.tres")
|
||||
Global.control.theme.default_font = latin_font
|
||||
|
||||
Global.config_cache.set_value("preferences", "locale", TranslationServer.get_locale())
|
||||
Global.config_cache.save("user://cache.ini")
|
||||
|
@ -90,7 +93,3 @@ func _on_Language_pressed(index : int) -> void:
|
|||
Global.update_hint_tooltips()
|
||||
Global.preferences_dialog._on_PreferencesDialog_popup_hide()
|
||||
Global.preferences_dialog._on_PreferencesDialog_about_to_show(true)
|
||||
|
||||
|
||||
func is_cjk(locale : String) -> bool:
|
||||
return "zh" in locale or "ko" in locale
|
||||
|
|
|
@ -51,7 +51,7 @@ size_flags_horizontal = 3
|
|||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
|
||||
margin_right = 498.0
|
||||
margin_bottom = 384.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Startup" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue