diff options
author | sfan5 <sfan5@live.de> | 2021-03-29 19:55:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 19:55:24 +0200 |
commit | 8d89f5f0cc1db47542bd355babad06b6bda54f51 (patch) | |
tree | 50cab3ca26b0c6e3f8f6435fb0ffcc47f6b50e1c /src/client/fontengine.h | |
parent | 5f4c78a77d99834887a714944899df92a4ebb573 (diff) | |
download | minetest-8d89f5f0cc1db47542bd355babad06b6bda54f51.tar.gz minetest-8d89f5f0cc1db47542bd355babad06b6bda54f51.tar.bz2 minetest-8d89f5f0cc1db47542bd355babad06b6bda54f51.zip |
Replace fallback font nonsense with automatic per-glyph fallback (#11084)
Diffstat (limited to 'src/client/fontengine.h')
-rw-r--r-- | src/client/fontengine.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/fontengine.h b/src/client/fontengine.h index e27ef60e9..3d389ea48 100644 --- a/src/client/fontengine.h +++ b/src/client/fontengine.h @@ -33,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, @@ -47,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); } @@ -132,10 +132,12 @@ public: 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 */ |