aboutsummaryrefslogtreecommitdiff
path: root/src/client/fontengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/fontengine.h')
-rw-r--r--src/client/fontengine.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/client/fontengine.h b/src/client/fontengine.h
index c6efa0df4..3d389ea48 100644
--- a/src/client/fontengine.h
+++ b/src/client/fontengine.h
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <map>
#include <vector>
#include "util/basic_macros.h"
+#include "irrlichttypes.h"
#include <IGUIFont.h>
#include <IGUISkin.h>
#include <IGUIEnvironment.h>
@@ -32,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
enum FontMode : u8 {
FM_Standard = 0,
FM_Mono,
- FM_Fallback,
+ _FM_Fallback, // do not use directly
FM_Simple,
FM_SimpleMono,
FM_MaxMode,
@@ -46,7 +47,7 @@ struct FontSpec {
bold(bold),
italic(italic) {}
- u16 getHash()
+ u16 getHash() const
{
return (mode << 2) | (static_cast<u8>(bold) << 1) | static_cast<u8>(italic);
}
@@ -61,7 +62,7 @@ class FontEngine
{
public:
- FontEngine(Settings* main_settings, gui::IGUIEnvironment* env);
+ FontEngine(gui::IGUIEnvironment* env);
~FontEngine();
@@ -127,17 +128,16 @@ public:
/** get font size for a specific mode */
unsigned int getFontSize(FontMode mode);
- /** initialize font engine */
- void initialize(Settings* main_settings, gui::IGUIEnvironment* env);
-
/** update internal parameters from settings */
void readSettings();
private:
+ irr::gui::IGUIFont *getFont(FontSpec spec, bool may_fail);
+
/** update content of font cache in case of a setting change made it invalid */
void updateFontCache();
- /** initialize a new font */
+ /** initialize a new TTF font */
gui::IGUIFont *initFont(const FontSpec &spec);
/** initialize a font without freetype */
@@ -149,9 +149,6 @@ private:
/** clean cache */
void cleanCache();
- /** pointer to settings for registering callbacks or reading config */
- Settings* m_settings = nullptr;
-
/** pointer to irrlicht gui environment */
gui::IGUIEnvironment* m_env = nullptr;