#include <fontengine.h>
|
| | FontEngine (gui::IGUIEnvironment *env) |
| | ~FontEngine () |
| gui::IGUIFont * | getFont (FontSpec spec) |
| gui::IGUIFont * | getFont (unsigned int font_size=FONT_SIZE_UNSPECIFIED, FontMode mode=FM_Unspecified) |
| unsigned int | getTextHeight (const FontSpec &spec) |
| | get text height for a specific font
|
| unsigned int | getTextHeight (unsigned int font_size=FONT_SIZE_UNSPECIFIED, FontMode mode=FM_Unspecified) |
| | get text width of a text for a specific font
|
| unsigned int | getTextWidth (const std::wstring &text, const FontSpec &spec) |
| unsigned int | getTextWidth (const std::wstring &text, unsigned int font_size=FONT_SIZE_UNSPECIFIED, FontMode mode=FM_Unspecified) |
| | get text width of a text for a specific font
|
| unsigned int | getTextWidth (const std::string &text, const FontSpec &spec) |
| unsigned int | getTextWidth (const std::string &text, unsigned int font_size=FONT_SIZE_UNSPECIFIED, FontMode mode=FM_Unspecified) |
| unsigned int | getLineHeight (const FontSpec &spec) |
| | get line height for a specific font (including empty room between lines)
|
| unsigned int | getLineHeight (unsigned int font_size=FONT_SIZE_UNSPECIFIED, FontMode mode=FM_Unspecified) |
| unsigned int | getDefaultFontSize () |
| | get default font size
|
| unsigned int | getFontSize (FontMode mode) |
| | get font size for a specific mode
|
| void | readSettings () |
| | update internal parameters from settings
|
| void | handleReload () |
| | reload fonts if settings were changed
|
| void | setMediaFont (const std::string &name, const std::string &data) |
| void | clearMediaFonts () |
|
| static void | fontSettingChanged (const std::string &name, void *userdata) |
| | callback to be used on change of font size setting
|
◆ FontEngine()
| FontEngine::FontEngine |
( |
gui::IGUIEnvironment * | env | ) |
|
◆ ~FontEngine()
| FontEngine::~FontEngine |
( |
| ) |
|
◆ clearCache()
| void FontEngine::clearCache |
( |
| ) |
|
|
private |
◆ clearMediaFonts()
| void FontEngine::clearMediaFonts |
( |
| ) |
|
◆ DISABLE_CLASS_COPY()
◆ fontSettingChanged()
| void FontEngine::fontSettingChanged |
( |
const std::string & | name, |
|
|
void * | userdata ) |
|
staticprivate |
◆ getDefaultFontSize()
| unsigned int FontEngine::getDefaultFontSize |
( |
| ) |
|
◆ getFont() [1/3]
| gui::IGUIFont * FontEngine::getFont |
( |
FontSpec | spec | ) |
|
◆ getFont() [2/3]
| gui::IGUIFont * FontEngine::getFont |
( |
FontSpec | spec, |
|
|
bool | may_fail ) |
|
private |
References _FM_Fallback, FontSpec::bold, FM_Unspecified, FONT_SIZE_UNSPECIFIED, FontSpec::getHash(), initFont(), FontSpec::italic, m_default_size, m_font_cache, m_font_mutex, FontSpec::mode, s_default_font_mode, and FontSpec::size.
◆ getFont() [3/3]
◆ getFontSize()
| unsigned int FontEngine::getFontSize |
( |
FontMode | mode | ) |
|
◆ getLineHeight() [1/2]
| unsigned int FontEngine::getLineHeight |
( |
const FontSpec & | spec | ) |
|
get line height for a specific font (including empty room between lines)
References getFont().
Referenced by getLineHeight().
◆ getLineHeight() [2/2]
◆ getOrLoadFace()
| gui::SGUITTFace * FontEngine::getOrLoadFace |
( |
const std::string & | filename | ) |
|
|
private |
◆ getTextHeight() [1/2]
| unsigned int FontEngine::getTextHeight |
( |
const FontSpec & | spec | ) |
|
◆ getTextHeight() [2/2]
◆ getTextWidth() [1/4]
| unsigned int FontEngine::getTextWidth |
( |
const std::string & | text, |
|
|
const FontSpec & | spec ) |
|
inline |
◆ getTextWidth() [2/4]
◆ getTextWidth() [3/4]
| unsigned int FontEngine::getTextWidth |
( |
const std::wstring & | text, |
|
|
const FontSpec & | spec ) |
◆ getTextWidth() [4/4]
◆ handleReload()
| void FontEngine::handleReload |
( |
| ) |
|
◆ initFont()
| gui::IGUIFont * FontEngine::initFont |
( |
FontSpec | spec | ) |
|
|
private |
initialize a new TTF font
References _FM_Fallback, FontSpec::allow_server_media, FontSpec::bold, gui::CGUITTFont::createTTFont(), errorstream, FM_Mono, FM_Unspecified, FONT_SIZE_UNSPECIFIED, g_settings, RenderingEngine::getDisplayDensity(), getFont(), Settings::getLayer(), getOrLoadFace(), infostream, FontSpec::italic, m_env, m_media_faces, FontSpec::mode, rangelim(), sanity_check, FontSpec::size, and SL_DEFAULTS.
Referenced by getFont().
◆ readSettings()
| void FontEngine::readSettings |
( |
| ) |
|
◆ refresh()
| void FontEngine::refresh |
( |
| ) |
|
|
private |
◆ setMediaFont()
| void FontEngine::setMediaFont |
( |
const std::string & | name, |
|
|
const std::string & | data ) |
◆ updateCache()
| void FontEngine::updateCache |
( |
| ) |
|
|
private |
◆ updateSkin()
| void FontEngine::updateSkin |
( |
| ) |
|
|
private |
◆ m_default_bold
| bool FontEngine::m_default_bold = false |
|
private |
◆ m_default_italic
| bool FontEngine::m_default_italic = false |
|
private |
◆ m_default_size
| unsigned int FontEngine::m_default_size[FM_MaxMode] |
|
private |
◆ m_env
| gui::IGUIEnvironment* FontEngine::m_env = nullptr |
|
private |
◆ m_font_cache
◆ m_font_mutex
| std::recursive_mutex FontEngine::m_font_mutex |
|
private |
◆ m_local_faces
| std::unordered_map<std::string, irr_ptr<gui::SGUITTFace> > FontEngine::m_local_faces |
|
private |
◆ m_media_faces
| std::unordered_map<std::string, irr_ptr<gui::SGUITTFace> > FontEngine::m_media_faces |
|
private |
◆ m_needs_reload
| bool FontEngine::m_needs_reload = false |
|
private |
◆ s_default_font_mode
The documentation for this class was generated from the following files: