mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-01 07:15:32 -04:00
cell: pack more efficiently and store glyph as a wchar
The 'attributes' struct is now 8 bytes and naturally packed (used to be 9 bytes, artificially packed). 'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes, artificially packed). Furthermore, the glyph is stored as a wchar instead of a char*. This makes it easier (faster) to do glyph lookup when rendering.
This commit is contained in:
parent
ab92abbd21
commit
4d7993b36f
9 changed files with 146 additions and 129 deletions
3
font.h
3
font.h
|
|
@ -22,6 +22,7 @@ struct glyph {
|
|||
int top;
|
||||
|
||||
double pixel_size_fixup;
|
||||
bool valid;
|
||||
};
|
||||
|
||||
typedef tll(struct glyph) hash_entry_t;
|
||||
|
|
@ -51,5 +52,5 @@ struct font {
|
|||
};
|
||||
|
||||
bool font_from_name(font_list_t names, const char *attributes, struct font *result);
|
||||
const struct glyph *font_glyph_for_utf8(struct font *font, const char *utf8);
|
||||
const struct glyph *font_glyph_for_wc(struct font *font, wchar_t wc);
|
||||
void font_destroy(struct font *font);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue