From 4146a96bbad12f18538381e4647165ed4da618df Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 11 Feb 2003 07:10:22 +0000 Subject: [PATCH] allow utf-8 in font maps --- stepmania/src/Font.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stepmania/src/Font.cpp b/stepmania/src/Font.cpp index a72b5f554e..3e17c9dedc 100644 --- a/stepmania/src/Font.cpp +++ b/stepmania/src/Font.cpp @@ -495,6 +495,7 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri * 1. U+hexval * 2. an alias ("kakumei1") * 3. a game type followed by a game alias, eg "pump menuleft" + * 4. a character in quotes ("X") * * map 1=2 is the same as * range unicode #1-1=2 @@ -523,6 +524,14 @@ void Font::LoadFontPageSettings(FontPageSettings &cfg, IniFile &ini, const CStri wchar_t c; if(codepoint.substr(0, 2) == "U+" && IsHexVal(codepoint.substr(2))) sscanf(codepoint.substr(2).c_str(), "%x", &c); + else if(codepoint.size() > 0 && + utf8_get_char_len(codepoint.c_str()) == codepoint.size()) + { + c = utf8_get_char(codepoint.c_str()); + if(c == wchar_t(-1)) + LOG->Warn("Font definition '%s' has an invalid value '%s'.", + ini.GetPath().GetString(), val.GetString() ); + } else if(!FontCharAliases::GetChar(codepoint, c)) { LOG->Warn("Font definition '%s' has an invalid value '%s'.",