mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-09 19:46:30 +00:00
Fonts: Added a ImFontFlags_NoLoadError flag to let user code try file paths. (3611)
This commit is contained in:
@@ -3096,7 +3096,8 @@ ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels,
|
||||
void* data = ImFileLoadToMemory(filename, "rb", &data_size, 0);
|
||||
if (!data)
|
||||
{
|
||||
IM_ASSERT_USER_ERROR(0, "Could not load font file!");
|
||||
if (font_cfg_template == NULL || (font_cfg_template->Flags & ImFontFlags_NoLoadError) == 0)
|
||||
IM_ASSERT_USER_ERROR(0, "Could not load font file!");
|
||||
return NULL;
|
||||
}
|
||||
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
|
||||
|
Reference in New Issue
Block a user