mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-23 05:33:57 -04:00
config: font->name may be NULL
If it is, fallback to the font pattern instead, like we used to do before fcft-3.
This commit is contained in:
parent
87c0d857cf
commit
b0e9ee2137
1 changed files with 6 additions and 2 deletions
8
config.c
8
config.c
|
|
@ -3250,10 +3250,14 @@ check_if_font_is_monospaced(const char *pattern,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (last_width >= 0 && g->advance.x != last_width) {
|
if (last_width >= 0 && g->advance.x != last_width) {
|
||||||
|
const char *font_name = f->name != NULL
|
||||||
|
? f->name
|
||||||
|
: pattern;
|
||||||
|
|
||||||
LOG_WARN("%s: font does not appear to be monospace; "
|
LOG_WARN("%s: font does not appear to be monospace; "
|
||||||
"check your config, or disable this warning by "
|
"check your config, or disable this warning by "
|
||||||
"setting [tweak].font-monospace-warn=no",
|
"setting [tweak].font-monospace-warn=no",
|
||||||
f->name);
|
font_name);
|
||||||
|
|
||||||
static const char fmt[] =
|
static const char fmt[] =
|
||||||
"%s: font does not appear to be monospace; "
|
"%s: font does not appear to be monospace; "
|
||||||
|
|
@ -3261,7 +3265,7 @@ check_if_font_is_monospaced(const char *pattern,
|
||||||
"setting \033[1m[tweak].font-monospace-warn=no\033[22m";
|
"setting \033[1m[tweak].font-monospace-warn=no\033[22m";
|
||||||
|
|
||||||
user_notification_add_fmt(
|
user_notification_add_fmt(
|
||||||
notifications, USER_NOTIFICATION_WARNING, fmt, f->name);
|
notifications, USER_NOTIFICATION_WARNING, fmt, font_name);
|
||||||
|
|
||||||
is_monospaced = false;
|
is_monospaced = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue