diff options
Diffstat (limited to 'src/text.h')
| -rw-r--r-- | src/text.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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); |
