foot/config.h
Daniel Eklöf 73b4d5d05a
font: add support for fallback fonts
A top-level font now has a list of fallback fonts. When a glyph cannot
be found, we try each fallback font in turn, until we either find one
that has the glyph, or until we've exhausted the list.

To make this actually work in practise (read: to make performance
acceptable), the cache is re-worked and is now populated on demand.

It also supports non-ASCII characters, by using the 4-byte unicode
character as index instead.

Since having an array that can be indexed by a 4-byte value isn't
really viable, we now have a simple hash table instead of an array.
2019-07-30 18:04:28 +02:00

33 lines
563 B
C

#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "terminal.h"
#include "tllist.h"
struct config {
char *term;
char *shell;
tll(char *) fonts;
struct {
uint32_t fg;
uint32_t bg;
uint32_t regular[8];
uint32_t bright[8];
} colors;
struct {
enum cursor_style style;
struct {
uint32_t text;
uint32_t cursor;
} color;
} cursor;
size_t render_worker_count;
};
bool config_load(struct config *conf);
void config_free(struct config conf);