Don't crash when trying to load a non-existent vector/bitmap character.
parent
02ab358bd9
commit
d8932772ef
|
@ -497,8 +497,10 @@ const BitmapFont::Glyph &BitmapFont::GetGlyph(char32_t codepoint) {
|
||||||
mid--;
|
mid--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the codepoint.
|
|
||||||
ASCIIReader reader = { mid, unifontData.cend() };
|
ASCIIReader reader = { mid, unifontData.cend() };
|
||||||
|
if(reader.AtEnd()) break;
|
||||||
|
|
||||||
|
// Read the codepoint.
|
||||||
char32_t foundCodepoint = reader.Read16HexBits();
|
char32_t foundCodepoint = reader.Read16HexBits();
|
||||||
reader.ExpectChar(':');
|
reader.ExpectChar(':');
|
||||||
|
|
||||||
|
@ -724,8 +726,10 @@ const VectorFont::Glyph &VectorFont::GetGlyph(char32_t codepoint) {
|
||||||
mid--;
|
mid--;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the codepoint.
|
|
||||||
ASCIIReader reader = { mid, lffData.cend() };
|
ASCIIReader reader = { mid, lffData.cend() };
|
||||||
|
if(reader.AtEnd()) break;
|
||||||
|
|
||||||
|
// Read the codepoint.
|
||||||
reader.ExpectChar('[');
|
reader.ExpectChar('[');
|
||||||
char32_t foundCodepoint = reader.Read16HexBits();
|
char32_t foundCodepoint = reader.Read16HexBits();
|
||||||
reader.ExpectChar(']');
|
reader.ExpectChar(']');
|
||||||
|
|
Loading…
Reference in New Issue