diff --git a/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp b/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp index 63a06be..1ac5131 100644 --- a/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp +++ b/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp @@ -220,6 +220,8 @@ static bool FontBuilder_Build(ImFontAtlas* atlas) for (size_t i = 0; i < atlas->ConfigData.size(); i++) { + double spaceAdvance = 0.0; + auto& config = atlas->ConfigData[i]; bool increaseSpacing = strstr(config.Name, "Seurat") != nullptr; @@ -232,8 +234,15 @@ static bool FontBuilder_Build(ImFontAtlas* atlas) glyph.getQuadAtlasBounds(u0, v0, u1, v1); double advance = glyph.getAdvance(); - if (increaseSpacing && glyph.getCodepoint() == ' ') - advance *= 1.5; + if (glyph.getCodepoint() == ' ') + { + if (increaseSpacing) + { + advance *= 1.5; + } + + spaceAdvance = advance; + } config.DstFont->AddGlyph( &config, @@ -247,20 +256,40 @@ static bool FontBuilder_Build(ImFontAtlas* atlas) u1 / packer.width, v0 / packer.height, advance); - - config.DstFont->AddGlyph( - &config, - 0x200B, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f); } + + // Used as a zero-width helper for automatic line breaks. + // This is useful for languages like Japanese to separate 'words' + // so that they don't get split mid-kana by the automatic splitter. + config.DstFont->AddGlyph( + &config, + 0x200B, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f); + + // A duplicate of the normal width space character. + // Overrides the unicode Four-Per-Em Space character. + // This can be used to add visual spacers that are ignored + // by the automatic line splitting logic. + config.DstFont->AddGlyph( + &config, + 0x2005, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + spaceAdvance); config.DstFont->BuildLookupTable(); } diff --git a/UnleashedRecomp/locale/config_locale.cpp b/UnleashedRecomp/locale/config_locale.cpp index eb953f8..a02b10f 100644 --- a/UnleashedRecomp/locale/config_locale.cpp +++ b/UnleashedRecomp/locale/config_locale.cpp @@ -418,7 +418,7 @@ CONFIG_DEFINE_LOCALE(MusicAttenuation) CONFIG_DEFINE_LOCALE(ChannelConfiguration) { { ELanguage::English, { "Channel Configuration", "Change the output mode for your audio device." } }, - { ELanguage::Japanese, { "チャンネル[設定:せってい]", "オーディオデバイスの\n[ 出 力 :しゅつりょく]モード\u200Bを[変更:へんこう]できます" } }, + { ELanguage::Japanese, { "チャンネル[設定:せってい]", "オーディオデバイスの\u200B[\u2005出\u2005力\u2005:しゅつりょく]モード\u200Bを[変更:へんこう]できます" } }, { ELanguage::German, { "Kanalkonfiguration", "Ändere den Ausgabemodus für dein Audioausgabegerät." } }, { ELanguage::French, { "Configuration sortie audio", "Modifie le mode de sortie pour votre périphérique audio." } }, { ELanguage::Spanish, { "Configuración de canales", "Cambia el modo de salida para tu dispositivo de audio." } }, @@ -497,7 +497,7 @@ CONFIG_DEFINE_LOCALE(Subtitles) CONFIG_DEFINE_LOCALE(BattleTheme) { { 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." } }, - { ELanguage::Japanese, { "バトルテーマ", "バトル[中:ちゅう]に\u200Bウェアホッグの\u200Bバトルテーマを\u200B[再生:さいせい]するか\u200B[選択:せんたく]できます\n\nこのオプションは\u200B[次回:じかい]のバトルに\u200B[適用:てきよう]されます\n\n[ 除 霊 :エクソシズム]ミッションと\u200Bミニボステーマは\u200B[影響:えいきょう]されません" } }, + { ELanguage::Japanese, { "バトルテーマ", "バトル[中:ちゅう]に\u200Bウェアホッグの\u200Bバトルテーマを\u200B[再生:さいせい]するか\u200B[選択:せんたく]できます\n\nこのオプションは\u200B[次回:じかい]のバトルに\u200B[適用:てきよう]されます\n\n[\u2005除\u2005霊\u2005:エクソシズム]ミッションと\u200Bミニボステーマは\u200B[影響:えいきょう]されません" } }, { 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." } }, { 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." } }, { 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." } }, diff --git a/UnleashedRecompResources b/UnleashedRecompResources index 19beb1d..3d579bc 160000 --- a/UnleashedRecompResources +++ b/UnleashedRecompResources @@ -1 +1 @@ -Subproject commit 19beb1d54c68560eebc8ea48a71cdb0afb82227c +Subproject commit 3d579bc2cd60bbd3e23567a80c943b1992a8191a