1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00
OpenMW/components/fontloader/fontloader.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 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_Version.h>
#include <MyGUI_XmlDocument.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
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
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;
const VFS::Manager* mVFS;
float mScalingFactor;
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);
FontLoader(const FontLoader&);
void operator=(const FontLoader&);
2013-06-06 20:13:30 +00:00
};
}
#endif