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

@ -189,6 +189,22 @@ FontManager::GetImGuiFont(types::FontCategory fontCategory)
return p->defaultFont_;
}
QFont FontManager::GetQFont(types::FontCategory fontCategory)
{
auto& textSettings = settings::TextSettings::Instance();
auto family = textSettings.font_family(fontCategory).GetValue();
auto styles = textSettings.font_style(fontCategory).GetValue();
units::font_size::points<double> size {
textSettings.font_point_size(fontCategory).GetValue()};
QFont font(QString::fromStdString(family));
font.setStyleName(QString::fromStdString(styles));
font.setPointSizeF(size.value());
return font;
}
std::shared_ptr<types::ImGuiFont>
FontManager::LoadImGuiFont(const std::string& family,
const std::vector<std::string>& styles,