From ec973af82e467d7816bae5daf83359dbe85233dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 30 May 2014 13:02:40 +0200 Subject: [PATCH] skip characters that don't have metrics --- src/text/glyph_store.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/text/glyph_store.cpp b/src/text/glyph_store.cpp index 4a4517b70..cbcf012dd 100644 --- a/src/text/glyph_store.cpp +++ b/src/text/glyph_store.cpp @@ -38,7 +38,11 @@ const Shaping FontStack::getShaping(const std::u32string &string) const { GlyphPlacement glyph = GlyphPlacement(0, chr, x, 0); shaped.push_back(glyph); i++; - x += metrics.find(chr)->second.advance; + + auto metrics_it = metrics.find(chr); + if (metrics_it != metrics.end()) { + x += metrics_it->second.advance; + } } return shaped; }