Commit 03868e14 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Default to font size 9 if not specified (fixes #11)

parent 70472693
Pipeline #298 passed with stages
in 1 minute and 18 seconds
......@@ -94,10 +94,16 @@ css_template_fill_font(GiraraTemplate* csstemplate, const char* font)
girara_template_set_variable_value(csstemplate, "font-family",
pango_font_description_get_family(descr));
char* size = g_strdup_printf("%d%s", pango_font_description_get_size(descr) / PANGO_SCALE,
pango_font_description_get_size_is_absolute(descr) == FALSE ? "pt" : "");
girara_template_set_variable_value(csstemplate, "font-size", size);
g_free(size);
const int font_size = pango_font_description_get_size(descr);
if (!font_size) {
girara_debug("no font size given, defaulting to 9");
girara_template_set_variable_value(csstemplate, "font-size", "9pt");
} else {
char* size = g_strdup_printf("%d%s", pango_font_description_get_size(descr) / PANGO_SCALE,
pango_font_description_get_size_is_absolute(descr) == FALSE ? "pt" : "");
girara_template_set_variable_value(csstemplate, "font-size", size);
g_free(size);
}
switch (pango_font_description_get_weight(descr)) {
case PANGO_WEIGHT_THIN:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment