diff --git a/config-verify.c b/config-verify.c index f5bb00d..aca6944 100644 --- a/config-verify.c +++ b/config-verify.c @@ -156,12 +156,13 @@ conf_verify_color(keychain_t *chain, const struct yml_node *node) bool conf_verify_font(keychain_t *chain, const struct yml_node *node) { - static const struct attr_info attrs[] = { - {"family", true, &conf_verify_string}, - {NULL, false, NULL}, - }; + if (!yml_is_scalar(node)) { + LOG_ERR("%s: font must be a fontconfig-formatted string", + conf_err_prefix(chain, node)); + return false; + } - return conf_verify_dict(chain, node, attrs); + return true; } bool diff --git a/config.c b/config.c index 63b4809..8c2a6d4 100644 --- a/config.c +++ b/config.c @@ -67,8 +67,7 @@ conf_to_color(const struct yml_node *node) struct font * conf_to_font(const struct yml_node *node) { - const struct yml_node *family = yml_get_value(node, "family"); - return font_new(family != NULL ? yml_value_as_string(family) : "monospace"); + return font_new(yml_value_as_string(node)); } struct deco *