mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-24 01:40:12 -05:00
font: load all fallbacks when instantiating a primary font
The caching of fallback fonts didn't work. It "worked" because we didn't free the fonts... When we started doing that, the fallback fonts were no longer cached. Another solution would have been to keep the cached fallback fonts around until exit, and free them there. But that didn't seem very clean. So, for now, load *all* fallbacks when instantiating a primary (non-fallback) font. Note that this slows down initial startup time.
This commit is contained in:
parent
5a80bcff18
commit
e218e19ea3
2 changed files with 44 additions and 115 deletions
4
font.h
4
font.h
|
|
@ -30,6 +30,8 @@ struct glyph {
|
|||
typedef tll(struct glyph) hash_entry_t;
|
||||
|
||||
struct font {
|
||||
char *name;
|
||||
|
||||
mtx_t lock;
|
||||
FT_Face face;
|
||||
int load_flags;
|
||||
|
|
@ -50,7 +52,7 @@ struct font {
|
|||
} strikeout;
|
||||
|
||||
bool is_fallback;
|
||||
tll(char *) fallbacks;
|
||||
tll(struct font *) fallbacks;
|
||||
|
||||
size_t ref_counter;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue