diff --git a/app/gui/themes.c b/app/gui/themes.c index 73cb6b1c4b..09d07fa078 100644 --- a/app/gui/themes.c +++ b/app/gui/themes.c @@ -493,20 +493,17 @@ themes_apply_theme (Gimp *gimp, if (! error && config->font_relative_size != 1.0) { - /* CSS does not like numbers with commas as the radix. - * To prevent, we create the string with a point used. */ - gchar *font_size_string = NULL; - gint font_size; - - font_size = config->font_relative_size * 100; - font_size_string = g_strdup_printf ("%d.%d", (font_size / 100), - font_size % 100); + /* Intermediate buffer for locale-independent float to string + * conversion. See issue #11048. + */ + gchar font_size_string[G_ASCII_DTOSTR_BUF_SIZE]; g_output_stream_printf (output, NULL, NULL, &error, "\n" "* { font-size: %srem; }", - font_size_string); - g_free (font_size_string); + g_ascii_dtostr (font_size_string, + G_ASCII_DTOSTR_BUF_SIZE, + config->font_relative_size)); } if (! error)