Closed walbourn closed 5 years ago
For now the workaround is to do the conversion in your app:
wchar_t temp[1024] = {};
int result = MultiByteToWideChar(CP_UTF8, 0, char-string, -1, temp, _countof(temp));
if (!result)
throw std::exception("MultiByteToWideChar"):
// Use temp to call SpriteFont->DrawString
Fixed in this pull request
There is momentum to adopting UTF-8 Everywhere which currently makes a it a little difficult to work with SpriteFont that uses
wchar_t
. The library should be updated with DrawString, MeasureString, and MeasureDrawBounds overloads that takechar
assuming it's UTF-8 (not ASCII or some other codepage).