mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
0dad41aec4
commit
06f25b1c8b
|
@ -1,3 +1,8 @@
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue