terminal font

This commit is contained in:
Linus Dierheimer
2021-03-11 17:21:18 +01:00
parent abd797a0bf
commit 33be85c4bc
8 changed files with 149 additions and 31 deletions
+16
View File
@@ -12,6 +12,8 @@ void ffInitState(FFstate* state)
state->passwd = getpwuid(getuid());
uname(&state->utsname);
sysinfo(&state->sysinfo);
state->terminal.value = NULL;
state->terminal.error = NULL;
}
void ffDefaultConfig(FFconfig* config)
@@ -131,6 +133,20 @@ void ffPrintGtkPretty(const char* gtk2, const char* gtk3, const char* gtk4)
}
}
void ffParseFont(char* font, char* buffer)
{
char name[64];
char size[32];
int scanned = sscanf(font, "%[^,], %[^,]", name, size);
if(scanned == 0)
strcpy(buffer, font);
else if(scanned == 1)
strcpy(buffer, name);
else
sprintf(buffer, "%s (%spt)", name, size);
}
void ffPrintError(FFinstance* instance, const char* key, const char* message)
{
if(!instance->config.showErrors)