Show Japanese text and close the gap in the top bar
Build / test (push) Successful in 35s
Build / build (push) Successful in 1m12s

Godot's built-in font has no Japanese, so kanji in song names showed as
boxes. The theme now sets Godot's own Open Sans SemiBold as its default
font, with Noto Sans JP Medium as fallback. The Noto file's line metrics
are set to Open Sans's, so line heights stay the same and every other
screen is pixel-identical; fonts/README.md explains how to redo it.

Search and Sync move right to where the Statistics button was.
This commit is contained in:
Sansan committed 2026-10-06 23:57:37 +02:00
1 parent a21b6e9b22
commit b40b160fde
13 files changed
+325 -15

No files matched your search

+10 -10
View File
@@ -3152,7 +3152,7 @@
},
"TopBar/SearchButton": {
"rect": [
1354.0,
1450.0,
8.0,
70.0,
40.0
@@ -3179,7 +3179,7 @@
},
"TopBar/SyncButton": {
"rect": [
1442.0,
1538.0,
8.0,
70.0,
40.0
@@ -6574,7 +6574,7 @@
},
"TopBar/SearchButton": {
"rect": [
1354.0,
1450.0,
8.0,
70.0,
40.0
@@ -6601,7 +6601,7 @@
},
"TopBar/SyncButton": {
"rect": [
1442.0,
1538.0,
8.0,
70.0,
40.0
@@ -10086,7 +10086,7 @@
},
"TopBar/SearchButton": {
"rect": [
1354.0,
1450.0,
8.0,
70.0,
40.0
@@ -10113,7 +10113,7 @@
},
"TopBar/SyncButton": {
"rect": [
1442.0,
1538.0,
8.0,
70.0,
40.0
@@ -15805,7 +15805,7 @@
},
"TopBar/SearchButton": {
"rect": [
1354.0,
1450.0,
8.0,
70.0,
40.0
@@ -15832,7 +15832,7 @@
},
"TopBar/SyncButton": {
"rect": [
1442.0,
1538.0,
8.0,
70.0,
40.0
@@ -23463,7 +23463,7 @@
},
"TopBar/SearchButton": {
"rect": [
1354.0,
1450.0,
8.0,
70.0,
40.0
@@ -23490,7 +23490,7 @@
},
"TopBar/SyncButton": {
"rect": [
1442.0,
1538.0,
8.0,
70.0,
40.0
+6 -1
View File
@@ -28,6 +28,11 @@ const SYNC_RESULT: Dictionary = {
"total_time": "00:00:03",
}
## Song names of the first soundtrack in the statistics, to show Japanese text.
const JAPANESE_SONGS: Array[String] = [
"時の回廊", "カエルのテーマ", "風の憧憬", "魔王決戦", "遥かなる時の彼方へ",
]
## The character pictures the fake server hands out.
const CHARACTERS_DIR: String = "res://characters"
@@ -84,7 +89,7 @@ static func soundtrack_statistics() -> Array[Dictionary]:
"song_uuid": "song-%d-%d" % [i, song],
"soundtrack_uuid": "soundtrack-%d" % i,
"soundtrack_name": SOUNDTRACKS[i],
"song_name": "Track %d" % (song + 1),
"song_name": JAPANESE_SONGS[song] if i == 0 else "Track %d" % (song + 1),
"times_played": maxi(0, played - song * 2),
})
var soundtrack: Dictionary = {
+16
View File
@@ -119,3 +119,19 @@ func test_main_window_background_comes_from_the_theme_and_lets_clicks_through()
assert_int(background.mouse_filter).is_equal(Control.MOUSE_FILTER_IGNORE)
assert_float(background.anchor_right).is_equal(1.0)
assert_float(background.anchor_bottom).is_equal(1.0)
func test_default_font_shows_japanese() -> void:
var font: Font = _theme.default_font
for character: String in "幕開けミッション":
var found: bool = font.fallbacks.any(
func(fallback: Font) -> bool: return fallback.has_char(character.unicode_at(0)))
assert_bool(found).override_failure_message("No font has " + character).is_true()
func test_japanese_fallback_keeps_the_line_height_of_godots_font() -> void:
var builtin: Font = ThemeDB.get_default_theme().default_font
for size: int in [16, 18, 20, 25, 35, 50]:
assert_float(_theme.default_font.get_height(size)) \
.override_failure_message("Line height at size %d" % size) \
.is_equal(builtin.get_height(size))