Half-ass Font class implementation
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m30s
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m30s
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user