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;
|
|
|
|
|
IVector2 size;
|
|
|
|
|
IVector2 bearing;
|
|
|
|
|
uint32 advance;
|
2022-04-13 13:01:35 +02:00
|
|
|
};
|
2022-04-15 11:19:30 +02:00
|
|
|
const Map<uint32, Glyph> getGlyphData() const { return glyphs; }
|
|
|
|
|
private:
|
2022-04-13 13:01:35 +02:00
|
|
|
Map<uint32, Glyph> glyphs;
|
|
|
|
|
};
|
|
|
|
|
DECLARE_REF(FontAsset)
|
|
|
|
|
} // namespace Seele
|