aboutsummaryrefslogtreecommitdiff
path: root/font.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-10-16 20:18:57 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-10-16 20:18:57 +0000
commit928e86b423f5ca5905a4b9525d25ac0e469564c2 (patch)
tree9cb3e187045a4dad6eccf1acceb78a3664c62f90 /font.h
parentfont: font_from_name() returns an allocated font struct (diff)
font: cache loaded fontconfig fallback fonts
Diffstat (limited to 'font.h')
-rw-r--r--font.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/font.h b/font.h
index 1d5ad4dc..424bbb7a 100644
--- a/font.h
+++ b/font.h
@@ -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,8 +52,13 @@ struct font {
bool is_fallback;
tll(char *) fallbacks;
+ /* 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;
};
struct font *font_from_name(font_list_t names, const char *attributes);