From ed4072bdd13262ff54bab86e08192163dad41b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 6 Feb 2014 09:47:12 +0100 Subject: [PATCH] skip unknown glyphs --- src/geometry/debug_font_buffer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/geometry/debug_font_buffer.cpp b/src/geometry/debug_font_buffer.cpp index ba180ff60..de0394c11 100644 --- a/src/geometry/debug_font_buffer.cpp +++ b/src/geometry/debug_font_buffer.cpp @@ -26,7 +26,13 @@ void DebugFontBuffer::addText(const char *text, double left, double baseline, do if (text[i] < 32 || text[i] > 127) { continue; } - glyph& glyph = simplex[(int)text[i]]; + + auto it = simplex.find((int)text[i]); + if (it == simplex.end()) { + continue; + } + + const glyph& glyph = it->second; if (!glyph.width) { continue; }