From c37acce23421d0ab74bd69a252b4ffa7a4265248 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 31 Jan 2003 21:43:56 +0000 Subject: [PATCH] fix incorrect width calculation with missing characters in font --- panda/src/text/textNode.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/text/textNode.cxx b/panda/src/text/textNode.cxx index 8cf643eb6c..56e849f690 100644 --- a/panda/src/text/textNode.cxx +++ b/panda/src/text/textNode.cxx @@ -1026,7 +1026,8 @@ measure_row(wstring::iterator &si, const wstring::iterator &send, const TextGlyph *glyph; float glyph_scale; - if (font->get_glyph(character, glyph, glyph_scale)) { + font->get_glyph(character, glyph, glyph_scale); + if (glyph != (TextGlyph *)NULL) { xpos += glyph->get_advance() * glyph_scale; } }