Stashing fonts, start font registry.
This commit is contained in:
22
fonts/Font.cc
Normal file
22
fonts/Font.cc
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "Font.h"
|
||||
|
||||
#include "imgui.h"
|
||||
|
||||
|
||||
void
|
||||
Font::Load(const float size) const
|
||||
{
|
||||
const ImGuiIO &io = ImGui::GetIO();
|
||||
io.Fonts->Clear();
|
||||
const ImFont *font = io.Fonts->AddFontFromMemoryCompressedTTF(
|
||||
this->data_,
|
||||
this->size_,
|
||||
size);
|
||||
|
||||
if (!font) {
|
||||
font = io.Fonts->AddFontDefault();
|
||||
}
|
||||
|
||||
(void) font;
|
||||
io.Fonts->Build();
|
||||
}
|
||||
Reference in New Issue
Block a user