Reuse parsed PangoFontDescription

Avoids parsing the configured font each time text is rendered.
This commit is contained in:
Hugo Osvaldo Barrera 2022-07-01 12:23:04 +02:00
parent 2f352c6f21
commit c5adc8c610
11 changed files with 52 additions and 49 deletions

View file

@ -227,7 +227,9 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,
case 'f': // Font
if (type) {
free(type->font);
pango_font_description_free(type->font_description);
type->font = strdup(optarg);
type->font_description = pango_font_description_from_string(type->font);
}
break;
case 'l': // Detailed Message