Fixes for CJK

* Fix ammo counter for CJK
* Add Korean to CJK list
* Minor additions for Czech
This commit is contained in:
Vlad Loktionov 2023-02-24 15:14:22 +03:00
parent 72eda99c65
commit 5c622d993a
7 changed files with 27 additions and 21 deletions

View File

@ -59,7 +59,7 @@ LUI.MenuBuilder.registerType("choose_language_menu", function(a1)
local lang = Engine.GetCurrentLanguage()
if language.isasian or not language.isnonlatin() or not config.get("disable_custom_fonts") then
if language.isasian() or not language.isnonlatin() or not config.get("disable_custom_fonts") then
setuniversalfont(id)
end
@ -108,7 +108,7 @@ LUI.MenuBuilder.registerType("choose_language_menu", function(a1)
return menu
end)
-- rup patch
-- fix for Y-offset in button text (russian_partial, default font)
if config.get("language") == "russian_partial" and config.get("disable_custom_fonts") then
LUI.UIButtonText.IsOffsetedLanguage = function()
return true
@ -116,12 +116,12 @@ if config.get("language") == "russian_partial" and config.get("disable_custom_fo
end
if not (config.get("disable_custom_fonts")) then
-- global patch
-- fix for Y-offset in button text (global patch, custom font)
LUI.UIButtonText.IsOffsetedLanguage = function()
return false
end
-- pol/rus patch
-- fix for ammo counter (polish/russian)
if not Engine.InFrontend() then
local weaponinfodef = LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"]
LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"] = function(...)
@ -149,8 +149,8 @@ if not (config.get("disable_custom_fonts")) then
end
end
-- ara/pol/rus patch
if language.ispolrus() or language.isarabic() then
-- fix for ammo counter (global patch)
if language.isnonlatin() then
local scale = function(size)
return size * 720 / 1080
end
@ -169,10 +169,12 @@ if not (config.get("disable_custom_fonts")) then
Font = RegisterFont("fonts/mix_gothic.ttf", 105),
Height = 64
}
CoD.TextSettings.H2TitleFont = {
Font = RegisterFont("fonts/mix_gothic.ttf", 56),
Height = scale(56)
}
-- forced gothic font for headers (arabic/slavic)
if language.isslavic() or language.isarabic() then
CoD.TextSettings.H2TitleFont = {
Font = RegisterFont("fonts/mix_gothic.ttf", 56),
Height = scale(56)
}
end
end
end

View File

@ -8,6 +8,8 @@ japanese_full,fonts/default.otf,fonts/mix.ttf,
japanese_full,fonts/defaultBold.otf,fonts/mix_open.ttf,
japanese_partial,fonts/default.otf,fonts/mix.ttf,
japanese_partial,fonts/defaultBold.otf,fonts/mix_open.ttf,
korean,fonts/default.otf,fonts/mix.ttf,
korean,fonts/defaultBold.otf,fonts/mix_open.ttf,
polish,fonts/bank.ttf,fonts/mix_gothic.ttf,
polish,fonts/default.otf,fonts/mix.ttf,
polish,fonts/defaultBold.otf,fonts/mix_open.ttf,

1 arabic fonts/bank.ttf fonts/mix_gothic.ttf
8 japanese_full fonts/defaultBold.otf fonts/mix_open.ttf
9 japanese_partial fonts/default.otf fonts/mix.ttf
10 japanese_partial fonts/defaultBold.otf fonts/mix_open.ttf
11 korean fonts/default.otf fonts/mix.ttf
12 korean fonts/defaultBold.otf fonts/mix_open.ttf
13 polish fonts/bank.ttf fonts/mix_gothic.ttf
14 polish fonts/default.otf fonts/mix.ttf
15 polish fonts/defaultBold.otf fonts/mix_open.ttf

View File

@ -7,8 +7,8 @@
"LOCALE_5": "Ruština",
"LOCALE_6": "Polština",
"LOCALE_7": "Portugalština",
"LOCALE_8": "Japonština (částečně)",
"LOCALE_9": "Japonština",
"LOCALE_8": "Japonština",
"LOCALE_9": "Japonština (částečně)",
"LOCALE_10": "Čínština (složité)",
"LOCALE_11": "Čínština (zjednodušené)",
"LOCALE_12": "Arabština",
@ -4103,6 +4103,7 @@
"MENU_YOU_MUST_SPECIFY_A_FILENAME": "Musíš zadat název souboru!",
"MENU_ARE_YOU_SURE_QUIT": "Opravdu chceš odejít?",
"MENU_QUIT_WARNING": "Opravdu chceš odejít?",
"MENU_SAVEQUIT_TEXT": "Opravdu chceš odejít? Ztratíš veškerý postup dosažený od posledního checkpointu.",
"MENU_CONTROLS": "Ovladání",
"MENU_CONTROLS_CAPS": "KLÁVESY",
"MENU_LOOK": "Pohled",
@ -5304,7 +5305,7 @@
"MENU_SP_CONTINUE_TO_SPECIAL_OPS": "Pokračovat do zvláštních operací",
"MENU_SP_CONTINUE_TO_SPECIAL_OPS_CAPS": "POKRAČOVAT DO ZVLÁŠTNÍCH OPERACÍ",
"MENU_SP_CONTINUE_TO_MULTIPLAYER": "Pokračovat do Multiplayeru",
"MENU_SP_FOR_THE_RECORD": "„Udělej v tom pořádek“",
"MENU_SP_FOR_THE_RECORD": "„Tohle jen pro pořádek“",
"MENU_SP_CHOOSE_A_DIFFERENT_OP": "Vybrat jinou operaci",
"MENU_SP_NO_STARS_FOR_LOCKED_OP": "Nezískáš žádné hvězdy dokud si neodemkneš tuto operaci.",
"MENU_SP_NOT_SIGNED_IN": "Nejsi přihlášen",

View File

@ -60,9 +60,9 @@ namespace filesystem
paths.push_back(path / "fallback");
}
if (language::is_polrus() || language::is_arabic())
if (language::is_slavic() || language::is_arabic())
{
paths.push_back(path / "polrus");
paths.push_back(path / "slavic");
}
paths.push_back(path / code);

View File

@ -30,7 +30,7 @@ namespace language
{game::LANGUAGE_RUSSIAN_PARTIAL},
};
std::unordered_set<game::language_t> polish_russian_languages =
std::unordered_set<game::language_t> slavic_languages =
{
{game::LANGUAGE_RUSSIAN},
{game::LANGUAGE_POLISH},
@ -44,6 +44,7 @@ namespace language
{game::LANGUAGE_JAPANESE_PARTIAL},
{game::LANGUAGE_TRADITIONAL_CHINESE},
{game::LANGUAGE_SIMPLIFIED_CHINESE},
{game::LANGUAGE_KOREAN},
};
std::unordered_set<game::language_t> custom_languages =
@ -109,9 +110,9 @@ namespace language
return non_latin_languages.contains(current());
}
bool is_polrus()
bool is_slavic()
{
return polish_russian_languages.contains(current());
return slavic_languages.contains(current());
}
bool is_arabic()

View File

@ -13,7 +13,7 @@ namespace language
game::language_t current();
bool is_non_latin();
bool is_polrus();
bool is_slavic();
bool is_arabic();
bool is_asian();
}

View File

@ -236,7 +236,7 @@ namespace ui_scripting
auto language_table = table();
language_table["isnonlatin"] = language::is_non_latin;
language_table["ispolrus"] = language::is_polrus;
language_table["isslavic"] = language::is_slavic;
language_table["isarabic"] = language::is_arabic;
language_table["isasian"] = language::is_asian;