Skip to content

Commit 82f81dc

Browse files
authored
Options menu fixes for Japanese (#436)
* fix options menu descriptions * add explanation for special gylph characters * update resources submodule
1 parent 5f55179 commit 82f81dc

3 files changed

Lines changed: 47 additions & 18 deletions

File tree

UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
220220

221221
for (size_t i = 0; i < atlas->ConfigData.size(); i++)
222222
{
223+
double spaceAdvance = 0.0;
224+
223225
auto& config = atlas->ConfigData[i];
224226
bool increaseSpacing = strstr(config.Name, "Seurat") != nullptr;
225227

@@ -232,8 +234,15 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
232234
glyph.getQuadAtlasBounds(u0, v0, u1, v1);
233235

234236
double advance = glyph.getAdvance();
235-
if (increaseSpacing && glyph.getCodepoint() == ' ')
236-
advance *= 1.5;
237+
if (glyph.getCodepoint() == ' ')
238+
{
239+
if (increaseSpacing)
240+
{
241+
advance *= 1.5;
242+
}
243+
244+
spaceAdvance = advance;
245+
}
237246

238247
config.DstFont->AddGlyph(
239248
&config,
@@ -247,20 +256,40 @@ static bool FontBuilder_Build(ImFontAtlas* atlas)
247256
u1 / packer.width,
248257
v0 / packer.height,
249258
advance);
250-
251-
config.DstFont->AddGlyph(
252-
&config,
253-
0x200B,
254-
0.0f,
255-
0.0f,
256-
0.0f,
257-
0.0f,
258-
0.0f,
259-
0.0f,
260-
0.0f,
261-
0.0f,
262-
0.0f);
263259
}
260+
261+
// Used as a zero-width helper for automatic line breaks.
262+
// This is useful for languages like Japanese to separate 'words'
263+
// so that they don't get split mid-kana by the automatic splitter.
264+
config.DstFont->AddGlyph(
265+
&config,
266+
0x200B,
267+
0.0f,
268+
0.0f,
269+
0.0f,
270+
0.0f,
271+
0.0f,
272+
0.0f,
273+
0.0f,
274+
0.0f,
275+
0.0f);
276+
277+
// A duplicate of the normal width space character.
278+
// Overrides the unicode Four-Per-Em Space character.
279+
// This can be used to add visual spacers that are ignored
280+
// by the automatic line splitting logic.
281+
config.DstFont->AddGlyph(
282+
&config,
283+
0x2005,
284+
0.0f,
285+
0.0f,
286+
0.0f,
287+
0.0f,
288+
0.0f,
289+
0.0f,
290+
0.0f,
291+
0.0f,
292+
spaceAdvance);
264293

265294
config.DstFont->BuildLookupTable();
266295
}

UnleashedRecomp/locale/config_locale.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ CONFIG_DEFINE_LOCALE(MusicAttenuation)
418418
CONFIG_DEFINE_LOCALE(ChannelConfiguration)
419419
{
420420
{ ELanguage::English, { "Channel Configuration", "Change the output mode for your audio device." } },
421-
{ ELanguage::Japanese, { "チャンネル[設定:せってい]", "オーディオデバイスの\n[ 出 力 :しゅつりょく]モード\u200Bを[変更:へんこう]できます" } },
421+
{ ELanguage::Japanese, { "チャンネル[設定:せってい]", "オーディオデバイスの\u200B[\u2005\u2005\u2005:しゅつりょく]モード\u200Bを[変更:へんこう]できます" } },
422422
{ ELanguage::German, { "Kanalkonfiguration", "Ändere den Ausgabemodus für dein Audioausgabegerät." } },
423423
{ ELanguage::French, { "Configuration sortie audio", "Modifie le mode de sortie pour votre périphérique audio." } },
424424
{ ELanguage::Spanish, { "Configuración de canales", "Cambia el modo de salida para tu dispositivo de audio." } },
@@ -497,7 +497,7 @@ CONFIG_DEFINE_LOCALE(Subtitles)
497497
CONFIG_DEFINE_LOCALE(BattleTheme)
498498
{
499499
{ ELanguage::English, { "Battle Theme", "Play the Werehog battle theme during combat.\n\nThis option will apply the next time you're in combat.\n\nExorcism missions and miniboss themes will be unaffected." } },
500-
{ ELanguage::Japanese, { "バトルテーマ", "バトル[中:ちゅう]に\u200Bウェアホッグの\u200Bバトルテーマを\u200B[再生:さいせい]するか\u200B[選択:せんたく]できます\n\nこのオプションは\u200B[次回:じかい]のバトルに\u200B[適用:てきよう]されます\n\n[ 除 霊 :エクソシズム]ミッションと\u200Bミニボステーマは\u200B[影響:えいきょう]されません" } },
500+
{ ELanguage::Japanese, { "バトルテーマ", "バトル[中:ちゅう]に\u200Bウェアホッグの\u200Bバトルテーマを\u200B[再生:さいせい]するか\u200B[選択:せんたく]できます\n\nこのオプションは\u200B[次回:じかい]のバトルに\u200B[適用:てきよう]されます\n\n[\u2005\u2005\u2005:エクソシズム]ミッションと\u200Bミニボステーマは\u200B[影響:えいきょう]されません" } },
501501
{ ELanguage::German, { "Kampfmusik", "Spiele die Kampfmusik des Werehogs während dem Kämpfen ab.\n\nDiese Option tritt das nächste Mal, wenn du in einen Kampf gerätst, in Kraft.\n\nExorzismen und Mini-Bosse werden hiervon nicht beeinflusst." } },
502502
{ ELanguage::French, { "Thème de combat", "Joue le thème de combat du Werehog pendant les combat.\n\nCette option s'appliquera la prochaine fois que vous serez en combat.\n\nLes missions d'exorcisme et les thèmes des miniboss ne seront pas affectés." } },
503503
{ ELanguage::Spanish, { "Tema de batalla", "Reproduce el tema de batalla del Werehog durante el combate.\n\nEsta opción se aplicará la próxima vez que entres en combate.\n\nLas misiones de exorcismo y los temas de los minijefes no se verán afectados." } },

UnleashedRecompResources

0 commit comments

Comments
 (0)