2022-04-13 13:01:35 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "Asset.h"
|
|
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
|
|
|
|
DECLARE_NAME_REF(Gfx, Texture2D)
|
|
|
|
|
class FontAsset : public Asset
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FontAsset();
|
|
|
|
|
FontAsset(const std::string& directory, const std::string& name);
|
|
|
|
|
FontAsset(const std::filesystem::path& fullPath);
|
|
|
|
|
virtual ~FontAsset();
|
|
|
|
|
virtual void save() override;
|
|
|
|
|
virtual void load() override;
|
2022-04-15 11:19:30 +02:00
|
|
|
|
2022-04-13 13:01:35 +02:00
|
|
|
struct Glyph
|
|
|
|
|
{
|
2022-04-15 11:19:30 +02:00
|
|
|
Gfx::PTexture2D texture;
|
2022-11-15 12:19:11 +01:00
|
|
|
Math::IVector2 size;
|
|
|
|
|
Math::IVector2 bearing;
|
2022-04-15 11:19:30 +02:00
|
|
|
uint32 advance;
|
2022-04-13 13:01:35 +02:00
|
|
|
};
|
2022-04-17 09:10:20 +02:00
|
|
|
const std::map<uint32, Glyph> getGlyphData() const { return glyphs; }
|
2022-04-15 11:19:30 +02:00
|
|
|
private:
|
2022-04-17 09:10:20 +02:00
|
|
|
std::map<uint32, Glyph> glyphs;
|
2022-04-13 13:01:35 +02:00
|
|
|
};
|
|
|
|
|
DECLARE_REF(FontAsset)
|
|
|
|
|
} // namespace Seele
|