mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 22:02:18 +02:00
Modify loadFont to fit in nonExplicitSupportedLngs
'ko-KR' or 'ko' is loaded browser by browser, in any case font will be loaded.
This commit is contained in:
parent
44832eb709
commit
9c830de743
@ -71,15 +71,14 @@ const alternativeFonts = {
|
||||
}
|
||||
|
||||
function loadFont(language: string) {
|
||||
Object.keys(alternativeFonts).forEach(l => {
|
||||
if (language == l) {
|
||||
alternativeFonts[l].forEach(f=> { document.fonts.add(f); });
|
||||
}
|
||||
else {
|
||||
alternativeFonts[l].forEach(f=> {
|
||||
if (f && f.status == "loaded") { document.fonts.delete(f); }
|
||||
});
|
||||
}
|
||||
let altFontLanguages = Object.keys(alternativeFonts);
|
||||
if (!alternativeFonts[language]) { language = language.split(/[-_/]/)[0]; }
|
||||
if (alternativeFonts[language]) {
|
||||
alternativeFonts[language].forEach(f => { document.fonts.add(f); });
|
||||
altFontLanguages.splice(altFontLanguages.indexOf(language), 0);
|
||||
}
|
||||
altFontLanguages.forEach(f=> {
|
||||
if (f && f.status == "loaded") { document.fonts.delete(f); }
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user