mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:10:05 +00:00
Use fonts defined by text settings for rendering
This commit is contained in:
parent
e37e64b3f2
commit
11ea4676cf
5 changed files with 47 additions and 79 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue