Use fonts defined by text settings for rendering

This commit is contained in:
Dan Paulat 2023-10-08 09:02:28 -05:00
parent e37e64b3f2
commit 11ea4676cf
5 changed files with 47 additions and 79 deletions

View file

@ -1032,6 +1032,9 @@ void MapWidget::initializeGL()
void MapWidget::paintGL()
{
auto defaultFont = manager::FontManager::Instance().GetImGuiFont(
types::FontCategory::Default);
p->frameDraws_++;
// Setup ImGui Frame
@ -1047,6 +1050,9 @@ void MapWidget::paintGL()
p->ImGuiCheckFonts();
ImGui::NewFrame();
// Set default font
ImGui::PushFont(defaultFont->font());
// Update pixel ratio
p->context_->set_pixel_ratio(pixelRatio());
@ -1069,6 +1075,9 @@ void MapWidget::paintGL()
p->lastItemPicked_ = false;
}
// Pop default font
ImGui::PopFont();
// Render ImGui Frame
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());