lottie: Add exception for lottie doesn't have exported glyph

Added handling logic for missing characters to prevent program hang.
This commit is contained in:
Jinny You 2024-06-05 19:54:29 +09:00 committed by Mira Grudzinska
parent 07e386007c
commit e346cbb5ca

View file

@ -1099,6 +1099,7 @@ static void _updateText(LottieLayer* layer, float frameNo)
cursor.y = ++line * (doc.height / scale);
}
//find the glyph
bool found = false;
for (auto g = text->font->chars.begin(); g < text->font->chars.end(); ++g) {
auto glyph = *g;
//draw matched glyphs
@ -1128,9 +1129,13 @@ static void _updateText(LottieLayer* layer, float frameNo)
//advance the cursor position horizontally
cursor.x += glyph->width + spacing + doc.tracking;
found = true;
break;
}
}
if (!found) ++p;
}
}