mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
ShapedText: Fix crash caused by failing to find a fallback font for all codepoints
This commit is contained in:
parent
eca83213eb
commit
bdc515e424
1 changed files with 5 additions and 9 deletions
|
|
@ -989,16 +989,15 @@ struct Shaper
|
||||||
}
|
}
|
||||||
|
|
||||||
auto glyphsIt = shapedGlyphs.find (startFrom);
|
auto glyphsIt = shapedGlyphs.find (startFrom);
|
||||||
|
|
||||||
// The stored glyphs data can be empty if there are input codepoints for which we failed to
|
|
||||||
// resolve a valid Typeface::Ptr.
|
|
||||||
if (glyphsIt == shapedGlyphs.end() || glyphsIt->value.data->empty())
|
|
||||||
return {};
|
|
||||||
|
|
||||||
WrappedGlyphs result;
|
WrappedGlyphs result;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
// The stored glyphs data can be empty if there are input codepoints for which we failed to
|
||||||
|
// resolve a valid Typeface::Ptr.
|
||||||
|
if (glyphsIt == shapedGlyphs.end() || glyphsIt->value.data->empty())
|
||||||
|
break;
|
||||||
|
|
||||||
const ShapedGlyph* start = glyphsIt->value.data->data();
|
const ShapedGlyph* start = glyphsIt->value.data->data();
|
||||||
const ShapedGlyph* const endIt = glyphsIt->value.data->data() + glyphsIt->value.data->size();
|
const ShapedGlyph* const endIt = glyphsIt->value.data->data() + glyphsIt->value.data->size();
|
||||||
|
|
||||||
|
|
@ -1024,9 +1023,6 @@ struct Shaper
|
||||||
break;
|
break;
|
||||||
|
|
||||||
++glyphsIt;
|
++glyphsIt;
|
||||||
|
|
||||||
if (glyphsIt == shapedGlyphs.end())
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue