Commit 06f25b1c authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

strip the size from the font name before using it.

2003-04-01  Sven Neumann  <sven@gimp.org>

	* app/text/gimptext-compat.c (text_render): strip the size from
	the font name before using it.
parent 0dad41ae
2003-04-01 Sven Neumann <sven@gimp.org>
* app/text/gimptext-compat.c (text_render): strip the size from
the font name before using it.
2003-04-01 Sven Neumann <sven@gimp.org>
 
* app/text/gimpfont.c: use a fixed size for the popup and clamp to
......@@ -59,6 +59,7 @@ text_render (GimpImage *gimage,
GimpText *gtext;
GimpLayer *layer;
GimpRGB color;
gchar *font;
gdouble size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
......@@ -74,6 +75,10 @@ text_render (GimpImage *gimage,
desc = pango_font_description_from_string (fontname);
size = PANGO_PIXELS (pango_font_description_get_size (desc));
pango_font_description_unset_fields (desc, PANGO_FONT_MASK_SIZE);
font = pango_font_description_to_string (desc);
pango_font_description_free (desc);
gimp_context_get_foreground (gimp_get_current_context (gimage->gimp),
......@@ -81,13 +86,15 @@ text_render (GimpImage *gimage,
gtext = g_object_new (GIMP_TYPE_TEXT,
"text", text,
"font", fontname,
"font", font,
"font-size", size,
"antialias", antialias,
"border", border,
"color", &color,
NULL);
g_free (font);
layer = gimp_text_layer_new (gimage, gtext);
g_object_unref (gtext);
......
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