| 51 | |
| 52 | std::vector<uint8_t> iconFontBuffer; |
| 53 | ImFont * imgui_instance::append_icon_font(const std::vector<uint8_t> & buffer) |
| 54 | { |
| 55 | ImGuiIO & io = ImGui::GetIO(); |
| 56 | iconFontBuffer = buffer; |
| 57 | static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 }; |
| 58 | ImFontConfig icons_config; |
| 59 | icons_config.MergeMode = true; |
| 60 | icons_config.PixelSnapH = true; |
| 61 | icons_config.FontDataOwnedByAtlas = false; |
| 62 | auto font = io.Fonts->AddFontFromMemoryTTF((void *)iconFontBuffer.data(), (int)iconFontBuffer.size(), 15.f, &icons_config, icons_ranges); |
| 63 | IM_ASSERT(font != NULL); |
| 64 | return font; |
| 65 | } |
| 66 | |
| 67 | imgui_instance::~imgui_instance() |
| 68 | { |
no test coverage detected