Failsafe for non-Ansi chars (for now).

This commit is contained in:
Patrick 2024-09-17 00:57:59 +02:00
parent d42ab3a258
commit 773d86ffd3

View File

@ -81,7 +81,7 @@ void UIApp::init(const AppInitArgs& args)
const unsigned posY = 100; const unsigned posY = 100;
for (const char chr : std::string_view("Dies ist ein Test-Text!")) for (const char chr : std::string_view("Dies ist ein Test-Text!"))
{ {
const UVFontMapEntry& entry = uvFontMap.entries[chr]; const UVFontMapEntry& entry = uvFontMap.entries[chr < 0 ? '_' : chr];
const UIVertex topLeft = { const UIVertex topLeft = {
.pos = {posX + entry.xOffset, posY + entry.yOffset}, .pos = {posX + entry.xOffset, posY + entry.yOffset},
.texcoord = {entry.uvX, entry.uvY} .texcoord = {entry.uvX, entry.uvY}