mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-17 16:17:02 +08:00
@@ -5,7 +5,6 @@
|
|||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
@@ -32,7 +31,7 @@ public:
|
|||||||
|
|
||||||
static std::vector<Vertex2D> vertices(const std::string& text, float x = 0.0f, float y = 0.0f, float scale = 1.0f);
|
static std::vector<Vertex2D> vertices(const std::string& text, float x = 0.0f, float y = 0.0f, float scale = 1.0f);
|
||||||
static GLuint text_texture();
|
static GLuint text_texture();
|
||||||
static const std::filesystem::path& font_path();
|
static const std::string& font_path();
|
||||||
private:
|
private:
|
||||||
FT_Library m_ft;
|
FT_Library m_ft;
|
||||||
FT_Face m_face;
|
FT_Face m_face;
|
||||||
@@ -41,7 +40,7 @@ private:
|
|||||||
float m_texture_height = 64;
|
float m_texture_height = 64;
|
||||||
|
|
||||||
static inline GLuint m_text_texture;
|
static inline GLuint m_text_texture;
|
||||||
static inline std::filesystem::path m_font_path{ASSETS_PATH "fonts/IBMPlexSans-Regular.ttf"};
|
static inline std::string m_font_path{ASSETS_PATH "fonts/IBMPlexSans-Regular.ttf"};
|
||||||
std::unordered_map<char8_t, Character> m_characters;
|
std::unordered_map<char8_t, Character> m_characters;
|
||||||
|
|
||||||
void load_character(char8_t c);
|
void load_character(char8_t c);
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ GLuint Font::text_texture() {
|
|||||||
return m_text_texture;
|
return m_text_texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fs::path& Font::font_path() {
|
const std::string& Font::font_path() {
|
||||||
return m_font_path;
|
return m_font_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user