Commit c3754839 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

app/text/gimptextlayout.[ch] allow to adjust letter-spacing.

2005-03-02  Sven Neumann  <sven@gimp.org>

	* app/text/gimptextlayout.[ch]
	* app/tools/gimptextoptions.h: allow to adjust letter-spacing.
parent 7b962482
2005-03-02 Sven Neumann <sven@gimp.org>
* app/text/gimptextlayout.[ch]
* app/tools/gimptextoptions.h: allow to adjust letter-spacing.
2005-03-01 Manish Singh <yosh@gimp.org>
* plug-ins/common/mail.c: use g_spawn_async_with_pipes instead of
......
......@@ -213,6 +213,22 @@ gimp_text_layout_new (GimpText *text,
text->line_spacing,
text->unit,
yres));
if (fabs (text->letter_spacing) > 0.1)
{
PangoAttrList *attrs = pango_attr_list_new ();
PangoAttribute *attr;
attr = pango_attr_letter_spacing_new (text->letter_spacing * PANGO_SCALE);
attr->start_index = 0;
attr->end_index = -1;
pango_attr_list_insert (attrs, attr);
pango_layout_set_attributes (layout->layout, attrs);
pango_attr_list_unref (attrs);
}
gimp_text_layout_position (layout);
switch (text->box_mode)
......
......@@ -61,7 +61,8 @@ enum
PROP_BASE_DIR,
PROP_JUSTIFICATION,
PROP_INDENTATION,
PROP_LINE_SPACING
PROP_LINE_SPACING,
PROP_LETTER_SPACING
};
......@@ -182,6 +183,11 @@ gimp_text_options_class_init (GimpTextOptionsClass *klass)
N_("Modify line spacing"),
-8192.0, 8192.0, 0.0,
GIMP_CONFIG_PARAM_DEFAULTS);
GIMP_CONFIG_INSTALL_PROP_DOUBLE (object_class, PROP_LETTER_SPACING,
"letter-spacing",
N_("Modify letter spacing"),
-8192.0, 8192.0, 0.0,
GIMP_CONFIG_PARAM_DEFAULTS);
}
static void
......@@ -230,6 +236,9 @@ gimp_text_options_get_property (GObject *object,
case PROP_LINE_SPACING:
g_value_set_double (value, options->line_spacing);
break;
case PROP_LETTER_SPACING:
g_value_set_double (value, options->letter_spacing);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -277,6 +286,9 @@ gimp_text_options_set_property (GObject *object,
case PROP_LINE_SPACING:
options->line_spacing = g_value_get_double (value);
break;
case PROP_LETTER_SPACING:
options->letter_spacing = g_value_get_double (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -407,7 +419,7 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
g_object_set_data (G_OBJECT (tool_options), "tool-options-vbox", vbox);
table = gtk_table_new (9, 3, FALSE);
table = gtk_table_new (10, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
......@@ -474,6 +486,13 @@ gimp_text_options_gui (GimpToolOptions *tool_options)
_("Line\nspacing:"), 0.0,
spinbutton, 1, GIMP_STOCK_LINE_SPACING);
spinbutton = gimp_prop_spin_button_new (config,
"letter-spacing", 1.0, 10.0, 1);
gtk_entry_set_width_chars (GTK_ENTRY (spinbutton), 5);
gimp_table_attach_stock (GTK_TABLE (table), row++,
_("Letter\nspacing:"), 0.0,
spinbutton, 1, GIMP_STOCK_LETTER_SPACING);
button = gtk_button_new_with_label (_("Create path from text"));
gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_set_sensitive (button, FALSE);
......
......@@ -48,6 +48,7 @@ struct _GimpTextOptions
GimpTextJustification justify;
gdouble indent;
gdouble line_spacing;
gdouble letter_spacing;
GimpSizeEntry *size_entry;
};
......
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