From 35e74c72abe3d9799a9c0f1a70afd07ae992a5bc Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 7 May 2018 20:32:17 +0200 Subject: [PATCH] imgui_freetype: skip missing glyphs as well to match our stb loader (#1671, #1703) --- misc/freetype/imgui_freetype.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/freetype/imgui_freetype.cpp b/misc/freetype/imgui_freetype.cpp index 8235ac5f..f7233bc3 100644 --- a/misc/freetype/imgui_freetype.cpp +++ b/misc/freetype/imgui_freetype.cpp @@ -182,6 +182,8 @@ namespace bool FreeTypeFont::CalcGlyphInfo(uint32_t codepoint, GlyphInfo &glyph_info, FT_Glyph& ft_glyph, FT_BitmapGlyph& ft_bitmap) { uint32_t glyph_index = FT_Get_Char_Index(FreetypeFace, codepoint); + if (glyph_index == 0) + return false; FT_Error error = FT_Load_Glyph(FreetypeFace, glyph_index, FreetypeLoadFlags); if (error) return false;