浏览代码

Added assert to catch font data loading failure in a location that's easier to understand

omar 10 年之前
父节点
当前提交
9c707b6d8f
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      imgui.cpp

+ 1 - 0
imgui.cpp

@@ -1333,6 +1333,7 @@ void ImGui::NewFrame()
             g.IO.Font = (ImBitmapFont*)ImGui::MemAlloc(sizeof(ImBitmapFont));
             new(g.IO.Font) ImBitmapFont();
             g.IO.Font->LoadFromMemory(fnt_data, fnt_size);
+			IM_ASSERT(g.IO.Font->IsLoaded());       // Font failed to load
             g.IO.FontYOffset = +1;
         }
         g.Initialized = true;