2015-05-01 01:41:33 +02:00
|
|
|
#ifndef OPENMW_COMPONENTS_FONTLOADER_H
|
|
|
|
#define OPENMW_COMPONENTS_FONTLOADER_H
|
2013-06-06 22:13:30 +02:00
|
|
|
|
2020-05-28 23:09:10 +04:00
|
|
|
#include <MyGUI_Version.h>
|
|
|
|
#include <MyGUI_XmlDocument.h>
|
|
|
|
|
2018-09-04 09:15:07 +04:00
|
|
|
#include <components/myguiplatform/myguidatamanager.hpp>
|
2013-06-06 22:13:30 +02:00
|
|
|
#include <components/to_utf8/to_utf8.hpp>
|
|
|
|
|
2015-05-01 01:41:33 +02:00
|
|
|
namespace VFS
|
|
|
|
{
|
|
|
|
class Manager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MyGUI
|
|
|
|
{
|
|
|
|
class ITexture;
|
|
|
|
class ResourceManualFont;
|
|
|
|
}
|
|
|
|
|
2014-09-12 04:27:23 +02:00
|
|
|
namespace Gui
|
2013-06-06 22:13:30 +02:00
|
|
|
{
|
2015-05-01 01:41:33 +02:00
|
|
|
/// @brief loads Morrowind's .fnt/.tex fonts for use with MyGUI and OSG
|
|
|
|
/// @note The FontLoader needs to remain in scope as long as you want to use the loaded fonts.
|
2013-06-06 22:13:30 +02:00
|
|
|
class FontLoader
|
|
|
|
{
|
|
|
|
public:
|
2022-07-09 19:58:40 +04:00
|
|
|
FontLoader(ToUTF8::FromType encoding, const VFS::Manager* vfs, float scalingFactor);
|
2014-08-11 20:37:29 +02:00
|
|
|
|
2023-08-07 17:40:38 +02:00
|
|
|
void overrideLineHeight(MyGUI::xml::ElementPtr _node, std::string_view _file, MyGUI::Version _version);
|
2020-05-28 23:09:10 +04:00
|
|
|
|
2023-05-21 16:39:32 +02:00
|
|
|
static std::string_view getFontForFace(std::string_view face);
|
2022-07-07 23:20:22 +04:00
|
|
|
|
2013-06-06 22:13:30 +02:00
|
|
|
private:
|
|
|
|
ToUTF8::FromType mEncoding;
|
2015-05-01 01:41:33 +02:00
|
|
|
const VFS::Manager* mVFS;
|
2021-04-15 15:14:41 +04:00
|
|
|
float mScalingFactor;
|
2015-05-01 01:41:33 +02:00
|
|
|
|
2022-08-23 09:35:13 +04:00
|
|
|
void loadFonts();
|
2022-08-20 15:07:23 +04:00
|
|
|
void loadFont(const std::string& fontName, const std::string& fontId);
|
2013-06-06 22:13:30 +02:00
|
|
|
|
2022-08-20 15:07:23 +04:00
|
|
|
void loadBitmapFont(const std::string& fileName, const std::string& fontId);
|
|
|
|
void loadTrueTypeFont(const std::string& fileName, const std::string& fontId);
|
2015-05-01 01:41:33 +02:00
|
|
|
|
|
|
|
FontLoader(const FontLoader&);
|
|
|
|
void operator=(const FontLoader&);
|
2013-06-06 22:13:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|