From 2bec83eec0dc2de2d6b8fb0b827e94807ed9b0b8 Mon Sep 17 00:00:00 2001 From: v-rob Date: Sun, 12 Jul 2020 00:48:50 -0700 Subject: Add FormSpec font styling options (#9763) * Add FormSpec font styling options * Change multiplication to stof * Remove extraneous check --- src/client/fontengine.cpp | 15 +++++++++++++++ src/client/fontengine.h | 3 +++ 2 files changed, 18 insertions(+) (limited to 'src/client') diff --git a/src/client/fontengine.cpp b/src/client/fontengine.cpp index 61d52cc2f..a55420846 100644 --- a/src/client/fontengine.cpp +++ b/src/client/fontengine.cpp @@ -186,6 +186,21 @@ unsigned int FontEngine::getDefaultFontSize() return m_default_size[m_currentMode]; } +unsigned int FontEngine::getFontSize(FontMode mode) +{ + if (m_currentMode == FM_Simple) { + if (mode == FM_Mono || mode == FM_SimpleMono) + return m_default_size[FM_SimpleMono]; + else + return m_default_size[FM_Simple]; + } + + if (mode == FM_Unspecified) + return m_default_size[FM_Standard]; + + return m_default_size[mode]; +} + /******************************************************************************/ void FontEngine::readSettings() { diff --git a/src/client/fontengine.h b/src/client/fontengine.h index 53f14c45f..865b2d3ff 100644 --- a/src/client/fontengine.h +++ b/src/client/fontengine.h @@ -124,6 +124,9 @@ public: /** get default font size */ unsigned int getDefaultFontSize(); + /** get font size for a specific mode */ + unsigned int getFontSize(FontMode mode); + /** initialize font engine */ void initialize(Settings* main_settings, gui::IGUIEnvironment* env); -- cgit v1.2.3