diff --git a/data/fonts/StkFont.xml b/data/fonts/StkFont.xml index 2774e0d9c..13640c3ac 100644 Binary files a/data/fonts/StkFont.xml and b/data/fonts/StkFont.xml differ diff --git a/data/fonts/rasheeq.xml b/data/fonts/rasheeq.xml index b721ca469..c8aedd16c 100644 Binary files a/data/fonts/rasheeq.xml and b/data/fonts/rasheeq.xml differ diff --git a/src/guiengine/scalable_font.cpp b/src/guiengine/scalable_font.cpp index 33dca09a2..62a6c4be2 100644 --- a/src/guiengine/scalable_font.cpp +++ b/src/guiengine/scalable_font.cpp @@ -131,6 +131,10 @@ void ScalableFont::doReadXmlFile(io::IXMLReader* xml) scale = xml->getAttributeValueAsFloat(L"scale"); //std::cout << "scale = " << scale << std::endl; + bool excludeFromMaxHeightCalculation = false; + if (xml->getAttributeValue(L"excludeFromMaxHeightCalculation")) + excludeFromMaxHeightCalculation = (core::stringc(xml->getAttributeValue(L"excludeFromMaxHeightCalculation")) == "true"); + core::stringw alpha = xml->getAttributeValue(L"hasAlpha"); //std::cout << "---- Adding font texture " << fn.c_str() << "; alpha=" << alpha.c_str() << std::endl; @@ -146,6 +150,7 @@ void ScalableFont::doReadXmlFile(io::IXMLReader* xml) info.m_file_name = fn; info.m_has_alpha = (alpha == core::stringw("true")); info.m_scale = scale; + info.m_exclude_from_max_height_calculation = excludeFromMaxHeightCalculation; #ifdef DEBUG @@ -280,19 +285,30 @@ void ScalableFont::setScale(const float scale) void ScalableFont::setMaxHeight() { - // FIXME: should consider per-texture scaling MaxHeight = 0; s32 t; - core::array< core::rect >& p = SpriteBank->getPositions(); + core::array< core::rect >& p = SpriteBank->getPositions(); + core::array< SGUISprite >& sprites = SpriteBank->getSprites(); for (u32 i=0; iMaxHeight) MaxHeight = t; } + MaxHeight = MaxHeight*m_scale; } diff --git a/src/guiengine/scalable_font.hpp b/src/guiengine/scalable_font.hpp index 3c96fe072..05fb44763 100644 --- a/src/guiengine/scalable_font.hpp +++ b/src/guiengine/scalable_font.hpp @@ -45,6 +45,7 @@ class ScalableFont : public IGUIFontBitmap irr::core::stringc m_file_name; bool m_has_alpha; float m_scale; + bool m_exclude_from_max_height_calculation; TextureInfo() {