fix assertion. only include glyphs with metrics

fixes bug caught by this assertion:
de3fd89b2c/src/mbgl/text/font_stack.cpp (L124)
This commit is contained in:
Ansis Brammanis
2015-05-29 13:33:30 -04:00
parent 36212ea3c6
commit 2ae2cade4a

View File

@@ -32,9 +32,9 @@ const Shaping FontStack::getShaping(const std::u32string &string, const float ma
// Loop through all characters of this label and shape.
for (uint32_t chr : string) {
shaping.positionedGlyphs.emplace_back(chr, x, y);
auto metric = metrics.find(chr);
if (metric != metrics.end()) {
shaping.positionedGlyphs.emplace_back(chr, x, y);
x += metric->second.advance + spacing;
}
}