mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Added a precaution to prevent crashes in case of broken fonts being used
This commit is contained in:
parent
75b93794b0
commit
7a8bd97226
|
@ -760,6 +760,9 @@ std::vector<Font::ShapeSegment> Font::shapeText(const std::string& text)
|
|||
lastCursor = textCursor;
|
||||
const unsigned int unicode {Utils::String::chars2Unicode(text, textCursor)};
|
||||
Glyph* currGlyph {getGlyph(unicode)};
|
||||
// Extra precaution in case the font is really broken.
|
||||
if (currGlyph == nullptr)
|
||||
continue;
|
||||
byteLength = textCursor - lastCursor;
|
||||
|
||||
if (unicode == '\'' || unicode == '\n' || currGlyph->fontHB == nullptr) {
|
||||
|
|
Loading…
Reference in a new issue