diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index ef6179d97f..a72b5f554e 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -520,24 +520,24 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri } } - longchar c=-1; + wchar_t c; if(codepoint.substr(0, 2) == "U+" && IsHexVal(codepoint.substr(2))) sscanf(codepoint.substr(2).c_str(), "%x", &c); - else + else if(!FontCharAliases::GetChar(codepoint, c)) { - c = FontCharAliases::GetChar(codepoint); - - if(c == INVALID_CHAR) - { - LOG->Warn("Font definition '%s' has an invalid value '%s'.", - ini.GetPath().GetString(), val.GetString() ); - continue; - } + LOG->Warn("Font definition '%s' has an invalid value '%s'.", + ini.GetPath().GetString(), val.GetString() ); + continue; } - if(game != GAME_INVALID) c = FontManager::MakeGameGlyph(wchar_t(c), game); + if(game != GAME_INVALID) + { + longchar lc = FontManager::MakeGameGlyph(c, game); + cfg.CharToGlyphNo[lc] = atoi(data); + } else { + cfg.CharToGlyphNo[c] = atoi(data); + } - cfg.CharToGlyphNo[c] = atoi(data); continue; } diff --git a/stepmania/src/FontCharAliases.cpp b/stepmania/src/FontCharAliases.cpp index 39d4833f01..0bc3300e2a 100644 --- a/stepmania/src/FontCharAliases.cpp +++ b/stepmania/src/FontCharAliases.cpp @@ -350,14 +350,15 @@ void FontCharAliases::ReplaceMarkers( CString &sText ) } /* Replace all &markers; and &#NNNN;s with UTF-8. */ -wchar_t FontCharAliases::GetChar( CString &codepoint ) +bool FontCharAliases::GetChar( CString &codepoint, wchar_t &ch ) { InitCharAliases(); aliasmap::const_iterator i = CharAliases.find(codepoint); if(i == CharAliases.end()) - return INVALID_CHAR; + return false; - return i->second; + ch = i->second; + return true; } /* diff --git a/stepmania/src/FontCharAliases.h b/stepmania/src/FontCharAliases.h index d91df44dd2..9837b96220 100644 --- a/stepmania/src/FontCharAliases.h +++ b/stepmania/src/FontCharAliases.h @@ -5,7 +5,7 @@ namespace FontCharAliases { void ReplaceMarkers( CString &sText ); - wchar_t GetChar( CString &codepoint ); + bool GetChar( CString &codepoint, wchar_t &ch ); }; #endif