Set font with DPI value

pull/770/head
Levin Li 2020-06-09 22:03:10 +08:00
parent ba308e4f19
commit 2ce81471f6
1 changed files with 3 additions and 3 deletions

View File

@ -4060,21 +4060,21 @@ CelestiaCore::ContextMenuHandler* CelestiaCore::getContextMenuHandler() const
#ifndef NO_TTF
void CelestiaCore::setFont(const fs::path& fontPath, int collectionIndex, int fontSize)
{
font = LoadTextureFont(renderer, fontPath, collectionIndex, fontSize);
font = LoadTextureFont(renderer, fontPath, collectionIndex, fontSize, screenDpi);
if (font != nullptr)
font->buildTexture();
}
void CelestiaCore::setTitleFont(const fs::path& fontPath, int collectionIndex, int fontSize)
{
titleFont = LoadTextureFont(renderer, fontPath, collectionIndex, fontSize);
titleFont = LoadTextureFont(renderer, fontPath, collectionIndex, fontSize, screenDpi);
if (titleFont != nullptr)
titleFont->buildTexture();
}
void CelestiaCore::setRendererFont(const fs::path& fontPath, int collectionIndex, int fontSize, Renderer::FontStyle fontStyle)
{
auto f = LoadTextureFont(renderer, fontPath, collectionIndex, fontSize);
auto f = LoadTextureFont(renderer, fontPath, collectionIndex, fontSize, screenDpi);
if (f != nullptr)
f->buildTexture();
renderer->setFont(fontStyle, f);