diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-10-16 20:35:44 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-10-16 20:35:44 +0000 |
| commit | 6f52b86105ff29cca3b8d58f35719f08a840700a (patch) | |
| tree | bd313d426d50e53a73e6296c696e2ffb468fea1e /font.h | |
| parent | selection: replace \r\n with \n in pasted text (diff) | |
| parent | font: cache top-level fonts (diff) | |
Merge branch 'font-cache'
Diffstat (limited to 'font.h')
| -rw-r--r-- | font.h | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -30,14 +30,12 @@ struct glyph { typedef tll(struct glyph) hash_entry_t; struct font { - FcPattern *fc_pattern; - FcFontSet *fc_fonts; - int fc_idx; - + mtx_t lock; FT_Face face; int load_flags; int render_flags; FT_LcdFilter lcd_filter; + double pixel_size_fixup; /* Scale factor - should only be used with ARGB32 glyphs */ bool bgr; /* True for FC_RGBA_BGR and FC_RGBA_VBGR */ @@ -54,10 +52,17 @@ struct font { bool is_fallback; tll(char *) fallbacks; + size_t ref_counter; + + /* Fields below are only valid for non-fallback fonts */ + FcPattern *fc_pattern; + FcFontSet *fc_fonts; + int fc_idx; + struct font **fc_loaded_fonts; /* fc_fonts->nfont array */ + hash_entry_t **cache; - mtx_t lock; }; -bool font_from_name(font_list_t names, const char *attributes, struct font *result); +struct font *font_from_name(font_list_t names, const char *attributes); const struct glyph *font_glyph_for_wc(struct font *font, wchar_t wc); void font_destroy(struct font *font); |
