2015-04-30 23:41:33 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_FONTLOADER_H
|
|
|
|
#define OPENMW_COMPONENTS_FONTLOADER_H
|
2013-06-06 20:13:30 +00:00
|
|
|
|
2020-05-28 19:09:10 +00:00
|
|
|
#include <MyGUI_Version.h>
|
|
|
|
#include <MyGUI_XmlDocument.h>
|
|
|
|
|
2018-09-04 05:15:07 +00:00
|
|
|
#include <components/myguiplatform/myguidatamanager.hpp>
|
2013-06-06 20:13:30 +00:00
|
|
|
#include <components/to_utf8/to_utf8.hpp>
|
|
|
|
|
2015-04-30 23:41:33 +00:00
|
|
|
namespace VFS
|
|
|
|
{
|
|
|
|
class Manager;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MyGUI
|
|
|
|
{
|
|
|
|
class ITexture;
|
|
|
|
class ResourceManualFont;
|
|
|
|
}
|
|
|
|
|
2014-09-12 02:27:23 +00:00
|
|
|
namespace Gui
|
2013-06-06 20:13:30 +00:00
|
|
|
{
|
2015-04-30 23:41:33 +00: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 20:13:30 +00:00
|
|
|
class FontLoader
|
|
|
|
{
|
|
|
|
public:
|
2022-07-09 15:58:40 +00:00
|
|
|
FontLoader(ToUTF8::FromType encoding, const VFS::Manager* vfs, float scalingFactor);
|
2014-08-11 18:37:29 +00:00
|
|
|
|
2023-08-07 15:40:38 +00:00
|
|
|
void overrideLineHeight(MyGUI::xml::ElementPtr _node, std::string_view _file, MyGUI::Version _version);
|
2020-05-28 19:09:10 +00:00
|
|
|
|
2023-05-21 14:39:32 +00:00
|
|
|
static std::string_view getFontForFace(std::string_view face);
|
2022-07-07 19:20:22 +00:00
|
|
|
|
2013-06-06 20:13:30 +00:00
|
|
|
private:
|
|
|
|
ToUTF8::FromType mEncoding;
|
2015-04-30 23:41:33 +00:00
|
|
|
const VFS::Manager* mVFS;
|
2021-04-15 11:14:41 +00:00
|
|
|
float mScalingFactor;
|
2015-04-30 23:41:33 +00:00
|
|
|
|
2022-08-23 05:35:13 +00:00
|
|
|
void loadFonts();
|
2022-08-20 11:07:23 +00:00
|
|
|
void loadFont(const std::string& fontName, const std::string& fontId);
|
2013-06-06 20:13:30 +00:00
|
|
|
|
2022-08-20 11:07:23 +00:00
|
|
|
void loadBitmapFont(const std::string& fileName, const std::string& fontId);
|
|
|
|
void loadTrueTypeFont(const std::string& fileName, const std::string& fontId);
|
2015-04-30 23:41:33 +00:00
|
|
|
|
|
|
|
FontLoader(const FontLoader&);
|
|
|
|
void operator=(const FontLoader&);
|
2013-06-06 20:13:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|