2008-04-03 04:53:51 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimptextlayer_pdb.c
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2008-04-03 04:53:51 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2008-04-03 04:53:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
2019-07-31 16:04:43 +08:00
|
|
|
* SECTION: gimptextlayer
|
2010-07-07 17:43:10 +08:00
|
|
|
* @title: gimptextlayer
|
|
|
|
* @short_description: Functions for querying and manipulating text layers.
|
|
|
|
*
|
|
|
|
* Functions for querying and manipulating text layers.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2008-04-03 04:53:51 +08:00
|
|
|
/**
|
|
|
|
* gimp_text_layer_new:
|
|
|
|
* @image_ID: The image.
|
|
|
|
* @text: The text to generate (in UTF-8 encoding).
|
|
|
|
* @fontname: The name of the font.
|
|
|
|
* @size: The size of text in either pixels or points.
|
|
|
|
* @unit: The units of specified size.
|
|
|
|
*
|
|
|
|
* Creates a new text layer.
|
|
|
|
*
|
|
|
|
* This procedure creates a new text layer. The arguments are kept as
|
|
|
|
* simple as necessary for the normal case. All text attributes,
|
|
|
|
* however, can be modified with the appropriate
|
|
|
|
* gimp_text_layer_set_*() procedures. The new layer still needs to be
|
|
|
|
* added to the image, as this is not automatic. Add the new layer
|
2010-09-06 06:03:29 +08:00
|
|
|
* using gimp_image_insert_layer().
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Returns: The new text layer.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gint32
|
|
|
|
gimp_text_layer_new (gint32 image_ID,
|
|
|
|
const gchar *text,
|
|
|
|
const gchar *fontname,
|
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit)
|
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-03 04:53:51 +08:00
|
|
|
gint32 layer_ID = -1;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_IMAGE_ID,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_DOUBLE,
|
|
|
|
GIMP_TYPE_UNIT,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_image_id (gimp_value_array_index (args, 0), image_ID);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), text);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 2), fontname);
|
|
|
|
g_value_set_double (gimp_value_array_index (args, 3), size);
|
|
|
|
g_value_set_int (gimp_value_array_index (args, 4), unit);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-new",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-new",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
layer_ID = gimp_value_get_layer_id (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
return layer_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_text:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the text from a text layer as string.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the text from a text layer as a string.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2019-08-01 04:51:35 +08:00
|
|
|
* Returns: (transfer full): The text from the specified text layer.
|
2019-08-05 04:09:04 +08:00
|
|
|
* The returned value must be freed with g_free().
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *
|
|
|
|
gimp_text_layer_get_text (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *text = NULL;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-text",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-text",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
text = g_value_dup_string (gimp_value_array_index (return_vals, 1));
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return text;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_text:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @text: The new text to set.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the text of a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure changes the text of a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_set_text (gint32 layer_ID,
|
|
|
|
const gchar *text)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), text);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-text",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-text",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2010-05-18 05:29:27 +08:00
|
|
|
/**
|
|
|
|
* gimp_text_layer_get_markup:
|
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
|
|
|
* Get the markup from a text layer as string.
|
|
|
|
*
|
|
|
|
* This procedure returns the markup of the styles from a text layer.
|
|
|
|
* The markup will be in the form of Pango's markup - See
|
2018-07-14 20:13:22 +08:00
|
|
|
* https://www.pango.org/ for more information about Pango and its
|
2010-05-18 05:29:27 +08:00
|
|
|
* markup. Note: Setting the markup of a text layer using Pango's
|
|
|
|
* markup is not supported for now.
|
|
|
|
*
|
2019-08-05 04:09:04 +08:00
|
|
|
* Returns: (transfer full):
|
|
|
|
* The markup which represents the style of the specified text layer.
|
|
|
|
* The returned value must be freed with g_free().
|
2010-05-18 05:29:27 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2010-05-18 05:29:27 +08:00
|
|
|
gchar *
|
|
|
|
gimp_text_layer_get_markup (gint32 layer_ID)
|
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-05-18 05:29:27 +08:00
|
|
|
gchar *markup = NULL;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-markup",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-markup",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2010-05-18 05:29:27 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
markup = g_value_dup_string (gimp_value_array_index (return_vals, 1));
|
2010-05-18 05:29:27 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-05-18 05:29:27 +08:00
|
|
|
|
|
|
|
return markup;
|
|
|
|
}
|
|
|
|
|
2008-04-03 04:53:51 +08:00
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_font:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the font from a text layer as string.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the name of the font from a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2019-08-05 04:09:04 +08:00
|
|
|
* Returns: (transfer full):
|
|
|
|
* The font which is used in the specified text layer.
|
|
|
|
* The returned value must be freed with g_free().
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *
|
|
|
|
gimp_text_layer_get_font (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *font = NULL;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-font",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-font",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
font = g_value_dup_string (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return font;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_font:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @font: The new font to use.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the font of a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure modifies the font used in the specified text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_set_font (gint32 layer_ID,
|
|
|
|
const gchar *font)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), font);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-font",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-font",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_font_size:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2019-08-05 21:31:12 +08:00
|
|
|
* @unit: (out) (transfer none): The unit used for the font size.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the font size from a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the size of the font which is used in a text
|
|
|
|
* layer. You will receive the size as a float 'font-size' in 'unit'
|
|
|
|
* units.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The font size.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble
|
|
|
|
gimp_text_layer_get_font_size (gint32 layer_ID,
|
|
|
|
GimpUnit *unit)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble font_size = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-font-size",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-font-size",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
2008-04-04 23:42:50 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
font_size = g_value_get_double (gimp_value_array_index (return_vals, 1));
|
|
|
|
*unit = g_value_get_int (gimp_value_array_index (return_vals, 2));
|
2008-04-04 23:42:50 +08:00
|
|
|
}
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return font_size;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_font_size:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @font_size: The font size.
|
|
|
|
* @unit: The unit to use for the font size.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the font size.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure changes the font size of a text layer. The size of
|
|
|
|
* your font will be a double 'font-size' of 'unit' units.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_set_font_size (gint32 layer_ID,
|
|
|
|
gdouble font_size,
|
|
|
|
GimpUnit unit)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_DOUBLE,
|
|
|
|
GIMP_TYPE_UNIT,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_double (gimp_value_array_index (args, 1), font_size);
|
|
|
|
g_value_set_int (gimp_value_array_index (args, 2), unit);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-font-size",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-font-size",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-10-27 15:59:32 +08:00
|
|
|
* gimp_text_layer_get_antialias:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* Check if antialiasing is used in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* This procedure checks if antialiasing is enabled in the specified
|
|
|
|
* text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2019-08-05 04:09:04 +08:00
|
|
|
* Returns: A flag which is true if antialiasing is used for rendering the font in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-10-27 15:59:32 +08:00
|
|
|
gimp_text_layer_get_antialias (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-10-27 15:59:32 +08:00
|
|
|
gboolean antialias = FALSE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-antialias",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-antialias",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
antialias = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-10-27 15:59:32 +08:00
|
|
|
return antialias;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-10-27 15:59:32 +08:00
|
|
|
* gimp_text_layer_set_antialias:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-10-27 15:59:32 +08:00
|
|
|
* @antialias: Enable/disable antialiasing of the text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* Enable/disable anti-aliasing in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* This procedure enables or disables anti-aliasing of the text in a
|
|
|
|
* text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-10-27 15:59:32 +08:00
|
|
|
gimp_text_layer_set_antialias (gint32 layer_ID,
|
|
|
|
gboolean antialias)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_boolean (gimp_value_array_index (args, 1), antialias);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-antialias",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-antialias",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-10-27 15:59:32 +08:00
|
|
|
* gimp_text_layer_get_hint_style:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* Get information about hinting in the specified text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* This procedure provides information about the hinting that is being
|
|
|
|
* used in a text layer. Hinting can be optimized for fidelity or
|
|
|
|
* contrast or it can be turned entirely off.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* Returns: The hint style used for font outlines.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-10-27 15:59:32 +08:00
|
|
|
GimpTextHintStyle
|
|
|
|
gimp_text_layer_get_hint_style (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-10-27 15:59:32 +08:00
|
|
|
GimpTextHintStyle style = 0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-hint-style",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-hint-style",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
style = g_value_get_enum (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-10-27 15:59:32 +08:00
|
|
|
return style;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-10-27 15:59:32 +08:00
|
|
|
* gimp_text_layer_set_hint_style:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-10-27 15:59:32 +08:00
|
|
|
* @style: The new hint style.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* Control how font outlines are hinted in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* This procedure sets the hint style for font outlines in a text
|
|
|
|
* layer. This controls whether to fit font outlines to the pixel grid,
|
|
|
|
* and if so, whether to optimize for fidelity or contrast.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-10-27 15:59:32 +08:00
|
|
|
gimp_text_layer_set_hint_style (gint32 layer_ID,
|
|
|
|
GimpTextHintStyle style)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
2019-07-31 00:45:10 +08:00
|
|
|
GIMP_TYPE_TEXT_HINT_STYLE,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_enum (gimp_value_array_index (args, 1), style);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-hint-style",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-hint-style",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_kerning:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Check if kerning is used in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure checks if kerning is enabled in the specified text
|
2008-04-03 04:53:51 +08:00
|
|
|
* layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: A flag which is true if kerning is used in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_get_kerning (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean kerning = FALSE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-kerning",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-kerning",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
kerning = g_value_get_boolean (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return kerning;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_kerning:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @kerning: Enable/disable kerning in the text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Enable/disable kerning in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure enables or disables kerning in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_set_kerning (gint32 layer_ID,
|
|
|
|
gboolean kerning)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_boolean (gimp_value_array_index (args, 1), kerning);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-kerning",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-kerning",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_language:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the language used in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the language string which is set for the text
|
|
|
|
* in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2019-08-01 04:51:35 +08:00
|
|
|
* Returns: (transfer full): The language used in the text layer.
|
2019-08-05 04:09:04 +08:00
|
|
|
* The returned value must be freed with g_free().
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *
|
|
|
|
gimp_text_layer_get_language (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *language = NULL;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-language",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-language",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
language = g_value_dup_string (gimp_value_array_index (return_vals, 1));
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return language;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_language:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @language: The new language to use for the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the language of the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure sets the language of the text in text layer. For some
|
|
|
|
* scripts the language has an influence of how the text is rendered.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean
|
|
|
|
gimp_text_layer_set_language (gint32 layer_ID,
|
|
|
|
const gchar *language)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), language);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-language",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-language",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_base_direction:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the base direction used for rendering the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the base direction used for rendering the
|
|
|
|
* text in the text layer
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The based direction used for the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
GimpTextDirection
|
|
|
|
gimp_text_layer_get_base_direction (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
GimpTextDirection direction = 0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-base-direction",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-base-direction",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
direction = g_value_get_enum (gimp_value_array_index (return_vals, 1));
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return direction;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_base_direction:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @direction: The base direction of the text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the base direction in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure sets the base direction used in applying the Unicode
|
|
|
|
* bidirectional algorithm when rendering the text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean
|
|
|
|
gimp_text_layer_set_base_direction (gint32 layer_ID,
|
|
|
|
GimpTextDirection direction)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
2019-07-31 00:45:10 +08:00
|
|
|
GIMP_TYPE_TEXT_DIRECTION,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_enum (gimp_value_array_index (args, 1), direction);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-base-direction",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-base-direction",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_justification:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the text justification information of the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the alignment of the lines in the text layer
|
|
|
|
* relative to each other.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The justification used in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
GimpTextJustification
|
|
|
|
gimp_text_layer_get_justification (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
GimpTextJustification justify = 0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-justification",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-justification",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
justify = g_value_get_enum (gimp_value_array_index (return_vals, 1));
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return justify;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_justification:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @justify: The justification for your text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the justification of the text in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure sets the alignment of the lines in the text layer
|
|
|
|
* relative to each other.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_set_justification (gint32 layer_ID,
|
|
|
|
GimpTextJustification justify)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
2019-07-31 00:45:10 +08:00
|
|
|
GIMP_TYPE_TEXT_JUSTIFICATION,
|
2019-07-30 16:51:16 +08:00
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_enum (gimp_value_array_index (args, 1), justify);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-justification",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-justification",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_color:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2019-08-01 21:39:13 +08:00
|
|
|
* @color: (out caller-allocates): The color of the text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the color of the text in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the color of the text in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gboolean
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_get_color (gint32 layer_ID,
|
|
|
|
GimpRGB *color)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-color",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-color",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-04 23:42:50 +08:00
|
|
|
|
|
|
|
if (success)
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_get_rgb (gimp_value_array_index (return_vals, 1), &*color);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_color:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @color: The color to use for the text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the color of the text in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure sets the text color in the text layer 'layer'.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean
|
|
|
|
gimp_text_layer_set_color (gint32 layer_ID,
|
|
|
|
const GimpRGB *color)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
GIMP_TYPE_RGB,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
gimp_value_set_rgb (gimp_value_array_index (args, 1), color);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-color",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-color",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_indent:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the line indentation of text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the indentation of the first line in a text
|
|
|
|
* layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The indentation value of the first line.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble
|
|
|
|
gimp_text_layer_get_indent (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble indent = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-indent",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-indent",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
indent = g_value_get_double (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return indent;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_indent:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @indent: The indentation for the first line.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Set the indentation of the first line in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure sets the indentation of the first line in the text
|
|
|
|
* layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean
|
|
|
|
gimp_text_layer_set_indent (gint32 layer_ID,
|
|
|
|
gdouble indent)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_DOUBLE,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_double (gimp_value_array_index (args, 1), indent);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-indent",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-indent",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_line_spacing:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the spacing between lines of text.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the line-spacing between lines of text in a
|
|
|
|
* text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The line-spacing value.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble
|
|
|
|
gimp_text_layer_get_line_spacing (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble line_spacing = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-line-spacing",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-line-spacing",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
line_spacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return line_spacing;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_line_spacing:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @line_spacing: The additional line spacing to use.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Adjust the line spacing in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure sets the additional spacing used between lines a text
|
2008-04-03 04:53:51 +08:00
|
|
|
* layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean
|
|
|
|
gimp_text_layer_set_line_spacing (gint32 layer_ID,
|
|
|
|
gdouble line_spacing)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_DOUBLE,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_double (gimp_value_array_index (args, 1), line_spacing);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-line-spacing",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-line-spacing",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_get_letter_spacing:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Get the letter spacing used in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure returns the additional spacing between the single
|
2016-06-26 04:54:10 +08:00
|
|
|
* glyphs in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The letter-spacing value.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-03 04:53:51 +08:00
|
|
|
gdouble
|
2008-04-04 23:42:50 +08:00
|
|
|
gimp_text_layer_get_letter_spacing (gint32 layer_ID)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble letter_spacing = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-get-letter-spacing",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-get-letter-spacing",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
|
|
|
|
letter_spacing = g_value_get_double (gimp_value_array_index (return_vals, 1));
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return letter_spacing;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-04-04 23:42:50 +08:00
|
|
|
* gimp_text_layer_set_letter_spacing:
|
2008-04-03 04:53:51 +08:00
|
|
|
* @layer_ID: The text layer.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @letter_spacing: The additional letter spacing to use.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Adjust the letter spacing in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* This procedure sets the additional spacing between the single glyphs
|
|
|
|
* in a text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: TRUE on success.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean
|
|
|
|
gimp_text_layer_set_letter_spacing (gint32 layer_ID,
|
|
|
|
gdouble letter_spacing)
|
2008-04-03 04:53:51 +08:00
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_DOUBLE,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_double (gimp_value_array_index (args, 1), letter_spacing);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-set-letter-spacing",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-set-letter-spacing",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2009-04-01 03:07:12 +08:00
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_text_layer_resize:
|
|
|
|
* @layer_ID: The text layer.
|
|
|
|
* @width: The new box width in pixels.
|
|
|
|
* @height: The new box height in pixels.
|
|
|
|
*
|
|
|
|
* Resize the box of a text layer.
|
|
|
|
*
|
|
|
|
* This procedure changes the width and height of a text layer while
|
|
|
|
* keeping it as a text layer and not converting it to a bitmap like
|
|
|
|
* gimp_layer_resize() would do.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.8
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2009-04-01 03:07:12 +08:00
|
|
|
gboolean
|
|
|
|
gimp_text_layer_resize (gint32 layer_ID,
|
|
|
|
gdouble width,
|
|
|
|
gdouble height)
|
|
|
|
{
|
2019-08-07 03:34:00 +08:00
|
|
|
GimpPDB *pdb = gimp_get_pdb ();
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2009-04-01 03:07:12 +08:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (GIMP_TYPE_LAYER_ID,
|
|
|
|
G_TYPE_DOUBLE,
|
|
|
|
G_TYPE_DOUBLE,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
gimp_value_set_layer_id (gimp_value_array_index (args, 0), layer_ID);
|
|
|
|
g_value_set_double (gimp_value_array_index (args, 1), width);
|
|
|
|
g_value_set_double (gimp_value_array_index (args, 2), height);
|
|
|
|
|
2019-08-07 03:34:00 +08:00
|
|
|
if (pdb)
|
|
|
|
return_vals = gimp_pdb_run_procedure_array (pdb,
|
|
|
|
"gimp-text-layer-resize",
|
|
|
|
args);
|
|
|
|
else
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_run_procedure_array ("gimp-text-layer-resize",
|
|
|
|
args);
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (args);
|
2009-04-01 03:07:12 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2009-04-01 03:07:12 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2009-04-01 03:07:12 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|