fix fatal error caused by some unicode characters

This commit is contained in:
MihailRis 2024-08-12 02:01:55 +03:00
parent c75f6e4e67
commit 698d02ceba

View File

@ -83,7 +83,10 @@ void Font::draw(Batch2D* batch, std::wstring_view text, int x, int y, FontStyle
}
uint charpage = c >> 8;
if (charpage == page){
Texture* texture = pages[charpage].get();
Texture* texture = nullptr;
if (charpage < pages.size()) {
texture = pages[charpage].get();
}
if (texture == nullptr){
texture = pages[0].get();
}