mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
font: load fallback fonts on demand
When instantiating a primary font, build the fallback font list, but don't actually instantiate the fallback fonts. Instead, remember the (full) pattern that we should use if/when we instantiate it. Then, when looking up a glyph and we need a fallback font, loop the list and instantiate the font(s) there and then.
This commit is contained in:
parent
e218e19ea3
commit
3c42691e1b
2 changed files with 35 additions and 19 deletions
7
font.h
7
font.h
|
|
@ -29,6 +29,11 @@ struct glyph {
|
|||
|
||||
typedef tll(struct glyph) hash_entry_t;
|
||||
|
||||
struct font_fallback {
|
||||
char *pattern;
|
||||
struct font *font;
|
||||
};
|
||||
|
||||
struct font {
|
||||
char *name;
|
||||
|
||||
|
|
@ -52,7 +57,7 @@ struct font {
|
|||
} strikeout;
|
||||
|
||||
bool is_fallback;
|
||||
tll(struct font *) fallbacks;
|
||||
tll(struct font_fallback) fallbacks;
|
||||
|
||||
size_t ref_counter;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue