Trying ttf loading

This commit is contained in:
Dynamitos
2022-04-13 13:01:46 +02:00
parent bebfb94752
commit 3fec36295a
42 changed files with 563 additions and 549 deletions
+31
View File
@@ -0,0 +1,31 @@
#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;
private:
struct Glyph
{
int16 index;
int16 numContours;
uint16 advance;
int16 leftSideBearing;
int16 boundingBox[4];
Vector2 center;
Gfx::PTexture2D curveTexture;
Gfx::PTexture2D bandTexture;
};
Map<uint32, Glyph> glyphs;
};
DECLARE_REF(FontAsset)
} // namespace Seele