font: initial support for fontconfig font fallback

When we've exhausted our own fallback list, try the font list provided
by fontconfig.

This means, the user's fallback fonts have priority, but in case all
of them fail, we hopefully get lucky with fontconfig...
This commit is contained in:
Daniel Eklöf 2019-08-10 20:34:22 +02:00
parent 75830ba016
commit 92319d1570
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 124 additions and 46 deletions

5
font.h
View file

@ -6,6 +6,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_LCD_FILTER_H
#include <fontconfig/fontconfig.h>
#include <cairo.h>
#include "tllist.h"
@ -28,6 +29,10 @@ struct glyph {
typedef tll(struct glyph) hash_entry_t;
struct font {
FcPattern *fc_pattern;
FcFontSet *fc_fonts;
int fc_idx;
FT_Face face;
int load_flags;
int render_flags;