diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-12-01 18:26:02 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-12-01 18:26:02 +0000 |
| commit | f15a2af0b8b0672b06cfcd6ae55ddd8164aa550e (patch) | |
| tree | 815a39d4c5adbfdf78ef5dc81b049ed545962e71 /terminal.c | |
| parent | meson: fcft: version must be 0.1.x (diff) | |
| parent | PKGBUILD: tllist is only a make dependency, bump fcft to 0.2.0 (diff) | |
Merge branch 'fcft-0.2.0'
Diffstat (limited to 'terminal.c')
| -rw-r--r-- | terminal.c | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -368,21 +368,18 @@ initialize_render_workers(struct terminal *term) static bool initialize_fonts(struct terminal *term, const struct config *conf) { - font_list_t font_names = tll_init(); - tll_foreach(conf->fonts, it) - tll_push_back(font_names, it->item); + const size_t count = tll_length(conf->fonts); + const char *names[count]; - if ((term->fonts[0] = font_from_name(font_names, "dpi=96")) == NULL || - (term->fonts[1] = font_from_name(font_names, "dpi=96:weight=bold")) == NULL || - (term->fonts[2] = font_from_name(font_names, "dpi=96:slant=italic")) == NULL || - (term->fonts[3] = font_from_name(font_names, "dpi=96:weight=bold:slant=italic")) == NULL) - { - tll_free(font_names); - return false; - } + size_t i = 0; + tll_foreach(conf->fonts, it) + names[i++] = it->item; - tll_free(font_names); - return true; + return ( + (term->fonts[0] = font_from_name(names, count, "dpi=96")) != NULL && + (term->fonts[1] = font_from_name(names, count, "dpi=96:weight=bold")) != NULL && + (term->fonts[2] = font_from_name(names, count, "dpi=96:slant=italic")) != NULL && + (term->fonts[3] = font_from_name(names, count, "dpi=96:weight=bold:slant=italic")) != NULL); } struct terminal * |
