*/
#include "fontengine.h"
#include "log.h"
-#include "main.h"
#include "config.h"
#include "porting.h"
#include "constants.h"
m_default_size[i] = (FontMode) FONT_SIZE_UNSPECIFIED;
}
- assert(m_settings != NULL);
- assert(m_env != NULL);
- assert(m_env->getSkin() != NULL);
+ assert(m_settings != NULL); // pre-condition
+ assert(m_env != NULL); // pre-condition
+ assert(m_env->getSkin() != NULL); // pre-condition
m_currentMode = FM_Simple;
if (font == NULL) {
font = m_env->getSkin()->getFont();
}
- assert(font != NULL);
+ FATAL_ERROR_IF(font == NULL, "Could not get skin font");
return font->getDimension(L"Some unimportant example String").Height;
}
if (font == NULL) {
font = m_env->getSkin()->getFont();
}
- assert(font != NULL);
+ FATAL_ERROR_IF(font == NULL, "Could not get font");
return font->getDimension(text.c_str()).Width;
}
if (font == NULL) {
font = m_env->getSkin()->getFont();
}
- assert(font != NULL);
+ FATAL_ERROR_IF(font == NULL, "Could not get font");
return font->getDimension(L"Some unimportant example String").Height
+ font->getKerningHeight();
// If we did fail to create a font our own make irrlicht find a default one
font = m_env->getSkin()->getFont();
- assert(font);
+ FATAL_ERROR_IF(font == NULL, "Could not create/get font");
u32 text_height = font->getDimension(L"Hello, world!").Height;
infostream << "text_height=" << text_height << std::endl;
/** initialize a font without freetype */
void FontEngine::initSimpleFont(unsigned int basesize, FontMode mode)
{
- assert((mode == FM_Simple) || (mode == FM_SimpleMono));
+ assert(mode == FM_Simple || mode == FM_SimpleMono); // pre-condition
std::string font_path = "";
if (mode == FM_Simple) {