Half-ass Font class implementation
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m30s

This commit is contained in:
2024-07-16 14:39:44 -04:00
parent abd691b648
commit 2d1e42c23b
6 changed files with 49 additions and 30 deletions

View File

@@ -6,6 +6,9 @@
#include <filesystem>
#include <iostream>
// LMFAO
extern "C" typedef struct FT_FaceRec_* FT_Face;
extern "C" typedef struct FT_LibraryRec_* FT_Library;
namespace JGL
{
@@ -18,13 +21,14 @@ namespace JGL
public:
/// Default constructor does not initialize any members
Font() = default;
Font(std::filesystem::path path);
Font(const std::filesystem::path& path);
/// Destructor handles freeing of the underlying asset handle.
~Font();
static Font LoadTTF(std::filesystem::path filepath);
static Font LoadTTF(const std::filesystem::path& filepath);
static std::vector<Font> GetLoadedFonts();
Vector2 MeasureString(const std::string& text, float ptSize);
public:
int index = 0;
FT_Face face;
};
}

View File

@@ -53,7 +53,7 @@ namespace JGL {
};
bool Update(const Vector2& window_size);
bool InitTextEngine();
//bool InitTextEngine();
Font LoadFont(const std::string& font_path); // TODO: Fully deprecate
void PurgeFontCache();