aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorv-rob <robinsonvincent89@gmail.com>2020-07-12 00:48:50 -0700
committerGitHub <noreply@github.com>2020-07-12 09:48:50 +0200
commit2bec83eec0dc2de2d6b8fb0b827e94807ed9b0b8 (patch)
tree591ae4dcce087d2fa2f4f295bdc2e4ab3725694d /src/client
parent1dd6c8ed7fc8b56385546437baa54d53b43a385f (diff)
downloadminetest-2bec83eec0dc2de2d6b8fb0b827e94807ed9b0b8.tar.gz
minetest-2bec83eec0dc2de2d6b8fb0b827e94807ed9b0b8.tar.bz2
minetest-2bec83eec0dc2de2d6b8fb0b827e94807ed9b0b8.zip
Add FormSpec font styling options (#9763)
* Add FormSpec font styling options * Change multiplication to stof * Remove extraneous check
Diffstat (limited to 'src/client')
-rw-r--r--src/client/fontengine.cpp15
-rw-r--r--src/client/fontengine.h3
2 files changed, 18 insertions, 0 deletions
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);