From cd18a78e924f262fda022cdaab1fc681cce42fec Mon Sep 17 00:00:00 2001 From: Fabrice Date: Wed, 11 Feb 2026 16:47:32 +0100 Subject: starting to upload fonts --- src/text.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/text.h') 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 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 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); -- cgit v1.2.3