Commit c33ed423 authored by mercury233's avatar mercury233 Committed by GitHub

update font fallback order (#2766)

parent efc86785
......@@ -106,6 +106,9 @@ bool Game::Initialize() {
numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 16);
if(!numFont) {
const wchar_t* numFontPaths[] = {
L"./fonts/numFont.ttf",
L"./fonts/numFont.ttc",
L"./fonts/numFont.otf",
L"C:/Windows/Fonts/arialbd.ttf",
L"/usr/share/fonts/truetype/DroidSansFallbackFull.ttf",
L"/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc",
......@@ -113,9 +116,6 @@ bool Game::Initialize() {
L"/usr/share/fonts/noto-cjk/NotoSansCJK-Bold.ttc",
L"/System/Library/Fonts/SFNSTextCondensed-Bold.otf",
L"/System/Library/Fonts/SFNS.ttf",
L"./fonts/numFont.ttf",
L"./fonts/numFont.ttc",
L"./fonts/numFont.otf"
};
for(const wchar_t* path : numFontPaths) {
BufferIO::CopyWideString(path, gameConf.numfont);
......@@ -127,6 +127,9 @@ bool Game::Initialize() {
textFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, gameConf.textfontsize);
if(!textFont) {
const wchar_t* textFontPaths[] = {
L"./fonts/textFont.ttf",
L"./fonts/textFont.ttc",
L"./fonts/textFont.otf",
L"C:/Windows/Fonts/msyh.ttc",
L"C:/Windows/Fonts/msyh.ttf",
L"C:/Windows/Fonts/simsun.ttc",
......@@ -139,9 +142,6 @@ bool Game::Initialize() {
L"/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
L"/System/Library/Fonts/PingFang.ttc",
L"/System/Library/Fonts/STHeiti Medium.ttc",
L"./fonts/textFont.ttf",
L"./fonts/textFont.ttc",
L"./fonts/textFont.otf"
};
for(const wchar_t* path : textFontPaths) {
BufferIO::CopyWideString(path, gameConf.textfont);
......@@ -159,7 +159,7 @@ bool Game::Initialize() {
}
});
if(fpath[0] == 0) {
ErrorLog("No fonts found! Please manually edit system.conf or place appropriate font file in the fonts directory.");
ErrorLog("No fonts found! Please place appropriate font file in the fonts directory, or edit system.conf manually.");
return false;
}
if(!numFont) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment