1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00
OpenMW/components/fontloader/fontloader.hpp

58 lines
1.3 KiB
C++
Raw Normal View History

#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_XmlDocument.h>
#include <MyGUI_Version.h>
#include <components/myguiplatform/myguidatamanager.hpp>
2013-06-06 20:13:30 +00:00
#include <components/to_utf8/to_utf8.hpp>
namespace VFS
{
class Manager;
}
namespace MyGUI
{
class ITexture;
class ResourceManualFont;
}
namespace Gui
2013-06-06 20:13:30 +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
void loadBitmapFonts ();
void loadTrueTypeFonts ();
2013-06-06 20:13:30 +00:00
2020-05-28 19:09:10 +00:00
void loadFontFromXml(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version);
int getFontHeight();
2022-07-07 19:20:22 +00:00
static std::string getFontForFace(const std::string& face);
2013-06-06 20:13:30 +00:00
private:
ToUTF8::FromType mEncoding;
const VFS::Manager* mVFS;
2020-05-28 19:09:10 +00:00
int mFontHeight;
float mScalingFactor;
std::vector<MyGUI::ResourceManualFont*> mFonts;
2013-06-06 20:13:30 +00:00
2022-07-07 19:20:22 +00:00
std::string getInternalFontName(const std::string& name);
void loadBitmapFont (const std::string& fileName);
FontLoader(const FontLoader&);
void operator=(const FontLoader&);
2013-06-06 20:13:30 +00:00
};
}
#endif