summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-18 17:20:11 -0400
committerpommicket <pommicket@gmail.com>2023-07-18 17:20:11 -0400
commiteb1c75720eaa8686c160e3ffa2559a03b5187e5a (patch)
tree47d1b9236ae45ba2392a64994c8fa8181c414630 /ted.c
parent9bee6a4bbd74a6ef9c317cfb54ffa7136644de4c (diff)
font fallbacksvariable-width
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ted.c b/ted.c
index 19d360c..1eec19c 100644
--- a/ted.c
+++ b/ted.c
@@ -313,7 +313,8 @@ static Font *ted_load_single_font(Ted *ted, const char *filename) {
static Font *ted_load_multifont(Ted *ted, const char *filenames) {
char filename[TED_PATH_MAX];
- Font *font = NULL;
+ Font *first_font = NULL;
+ Font *curr_font = NULL;
while (*filenames) {
while (*filenames == ',') ++filenames;
@@ -321,12 +322,17 @@ static Font *ted_load_multifont(Ted *ted, const char *filenames) {
strn_cpy(filename, sizeof filename, filenames, len);
str_trim(filename);
if (*filename) {
- font = ted_load_single_font(ted, filename);
+ Font *font = ted_load_single_font(ted, filename);
+ if (!first_font)
+ first_font = font;
+ if (curr_font)
+ text_font_set_fallback(curr_font, font);
+ curr_font = font;
}
filenames += len;
}
- return font;
+ return first_font;
}
void ted_load_fonts(Ted *ted) {