summaryrefslogtreecommitdiff
path: root/src/text.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-11 16:47:32 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-11 16:47:32 +0100
commitcd18a78e924f262fda022cdaab1fc681cce42fec (patch)
treede17016bd7a3b189114362deb728d3b623a6af9e /src/text.h
parenta1dee625dae4c3e39eb6ef16b91be9a374f7874f (diff)
starting to upload fonts
Diffstat (limited to 'src/text.h')
-rw-r--r--src/text.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/text.h b/src/text.h
index 464b956..e507221 100644
--- a/src/text.h
+++ b/src/text.h
@@ -4,6 +4,8 @@
#include "hash.h"
#include "utils.h"
+typedef u32 codepoint_t;
+
enum font_context_error_e {
FONT_CONTEXT_ERROR_NONE,
FONT_CONTEXT_ERROR_LIBRARY,
@@ -18,22 +20,21 @@ void wayc_font_context_deinit(struct font_context_s* ctx);
struct glyph_s {};
-struct font_cache_s {
- struct hashmap_s<u32, struct glyph_s> glyphs;
-};
-
enum font_error_e {
FONT_ERROR_NONE,
FONT_ERROR_FILE_LOAD,
FONT_ERROR_FONT_LOAD,
+ FONT_ERROR_NOT_MATCH,
};
struct font_s {
u8* data;
FT_Face face;
- struct font_cache_s cache;
+ struct hashmap_s<codepoint_t, struct glyph_s> cache;
};
enum font_error_e wayc_font_init(struct font_s* font,
struct font_context_s* ctx, const char* path);
+enum font_error_e wayc_font_lookup(struct font_s* font, codepoint_t codepoint,
+ struct glyph_s* out);
void wayc_font_deinit(struct font_s* font);