mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
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:
parent
07e386007c
commit
e346cbb5ca
1 changed files with 5 additions and 0 deletions
|
@ -1099,6 +1099,7 @@ static void _updateText(LottieLayer* layer, float frameNo)
|
||||||
cursor.y = ++line * (doc.height / scale);
|
cursor.y = ++line * (doc.height / scale);
|
||||||
}
|
}
|
||||||
//find the glyph
|
//find the glyph
|
||||||
|
bool found = false;
|
||||||
for (auto g = text->font->chars.begin(); g < text->font->chars.end(); ++g) {
|
for (auto g = text->font->chars.begin(); g < text->font->chars.end(); ++g) {
|
||||||
auto glyph = *g;
|
auto glyph = *g;
|
||||||
//draw matched glyphs
|
//draw matched glyphs
|
||||||
|
@ -1128,9 +1129,13 @@ static void _updateText(LottieLayer* layer, float frameNo)
|
||||||
|
|
||||||
//advance the cursor position horizontally
|
//advance the cursor position horizontally
|
||||||
cursor.x += glyph->width + spacing + doc.tracking;
|
cursor.x += glyph->width + spacing + doc.tracking;
|
||||||
|
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found) ++p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue