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
|
|
|
|
* <http://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"
|
2008-10-27 15:59:32 +08:00
|
|
|
#undef GIMP_DISABLE_DEPRECATED
|
|
|
|
#undef __GIMP_TEXT_LAYER_PDB_H__
|
|
|
|
#include "gimptextlayer_pdb.h"
|
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
|
|
|
|
* using gimp_image_add_layer().
|
|
|
|
*
|
|
|
|
* Returns: The new text layer.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
gint32
|
|
|
|
gimp_text_layer_new (gint32 image_ID,
|
|
|
|
const gchar *text,
|
|
|
|
const gchar *fontname,
|
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gint32 layer_ID = -1;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-new",
|
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_IMAGE, image_ID,
|
|
|
|
GIMP_PDB_STRING, text,
|
|
|
|
GIMP_PDB_STRING, fontname,
|
|
|
|
GIMP_PDB_FLOAT, size,
|
|
|
|
GIMP_PDB_INT32, unit,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
layer_ID = return_vals[1].data.d_layer;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
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
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The text from the specified text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *text = NULL;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-text",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
text = g_strdup (return_vals[1].data.d_string);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-text",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_STRING, text,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
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
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The font which is used in the specified text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *font = NULL;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-font",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
font = g_strdup (return_vals[1].data.d_string);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-font",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_STRING, font,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
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.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @unit: 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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble font_size = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-font-size",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
font_size = return_vals[1].data.d_float;
|
|
|
|
*unit = return_vals[2].data.d_unit;
|
|
|
|
}
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-font-size",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_FLOAT, font_size,
|
|
|
|
GIMP_PDB_INT32, unit,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
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
|
|
|
*
|
2008-10-27 15:59:32 +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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-10-27 15:59:32 +08:00
|
|
|
gboolean antialias = FALSE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-10-27 15:59:32 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-antialias",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2008-10-27 15:59:32 +08:00
|
|
|
antialias = return_vals[1].data.d_int32;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2008-10-27 15:59:32 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-antialias",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-10-27 15:59:32 +08:00
|
|
|
GIMP_PDB_INT32, antialias,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
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
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* Since: GIMP 2.8
|
2008-04-03 04:53:51 +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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-10-27 15:59:32 +08:00
|
|
|
GimpTextHintStyle style = 0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-10-27 15:59:32 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-hint-style",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2008-10-27 15:59:32 +08:00
|
|
|
style = return_vals[1].data.d_int32;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
|
|
|
*
|
2008-10-27 15:59:32 +08:00
|
|
|
* Since: GIMP 2.8
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2008-10-27 15:59:32 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-hint-style",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-10-27 15:59:32 +08:00
|
|
|
GIMP_PDB_INT32, style,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean kerning = FALSE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-kerning",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
kerning = return_vals[1].data.d_int32;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-kerning",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_INT32, kerning,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
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
|
|
|
*
|
2008-04-04 23:42:50 +08:00
|
|
|
* Returns: The language used in the text layer.
|
2008-04-03 04:53:51 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gchar *language = NULL;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-language",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
language = g_strdup (return_vals[1].data.d_string);
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-language",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_STRING, language,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
GimpTextDirection direction = 0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-base-direction",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2008-04-04 23:42:50 +08:00
|
|
|
direction = return_vals[1].data.d_int32;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-base-direction",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_INT32, direction,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
GimpTextJustification justify = 0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-justification",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2008-04-04 23:42:50 +08:00
|
|
|
justify = return_vals[1].data.d_int32;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-justification",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_INT32, justify,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
2008-04-04 23:42:50 +08:00
|
|
|
* @color: 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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-color",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
*color = return_vals[1].data.d_color;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-color",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_COLOR, color,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble indent = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-indent",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2008-04-04 23:42:50 +08:00
|
|
|
indent = return_vals[1].data.d_float;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-indent",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_FLOAT, indent,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble line_spacing = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-line-spacing",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
line_spacing = return_vals[1].data.d_float;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-line-spacing",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_FLOAT, line_spacing,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
|
* glyps 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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gdouble letter_spacing = 0.0;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-letter-spacing",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2008-04-04 23:42:50 +08:00
|
|
|
letter_spacing = return_vals[1].data.d_float;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
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
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
2008-04-04 23:42:50 +08:00
|
|
|
gboolean success = TRUE;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-letter-spacing",
|
2008-04-03 04:53:51 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
2008-04-04 23:42:50 +08:00
|
|
|
GIMP_PDB_FLOAT, letter_spacing,
|
2008-04-03 04:53:51 +08:00
|
|
|
GIMP_PDB_END);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
2008-04-03 04:53:51 +08:00
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.8
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_text_layer_resize (gint32 layer_ID,
|
|
|
|
gdouble width,
|
|
|
|
gdouble height)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-resize",
|
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_FLOAT, width,
|
|
|
|
GIMP_PDB_FLOAT, height,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
2008-04-04 23:42:50 +08:00
|
|
|
return success;
|
2008-04-03 04:53:51 +08:00
|
|
|
}
|
2008-10-27 15:59:32 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_text_layer_get_hinting:
|
|
|
|
* @layer_ID: The text layer.
|
|
|
|
* @autohint: A flag which is true if the text layer is forced to use the autohinter from FreeType.
|
|
|
|
*
|
|
|
|
* This procedure is deprecated! Use gimp_text_layer_get_hint_style()
|
|
|
|
* instead.
|
|
|
|
*
|
|
|
|
* Returns: A flag which is true if hinting is used on the font.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_text_layer_get_hinting (gint32 layer_ID,
|
|
|
|
gboolean *autohint)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean hinting = FALSE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-get-hinting",
|
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
|
|
|
hinting = return_vals[1].data.d_int32;
|
|
|
|
*autohint = return_vals[2].data.d_int32;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return hinting;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_text_layer_set_hinting:
|
|
|
|
* @layer_ID: The text layer.
|
|
|
|
* @hinting: Enable/disable the use of hinting on the text.
|
|
|
|
* @autohint: Force the use of the autohinter provided through FreeType.
|
|
|
|
*
|
|
|
|
* This procedure is deprecated! Use gimp_text_layer_set_hint_style()
|
|
|
|
* instead.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: GIMP 2.6
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gimp_text_layer_set_hinting (gint32 layer_ID,
|
|
|
|
gboolean hinting,
|
|
|
|
gboolean autohint)
|
|
|
|
{
|
|
|
|
GimpParam *return_vals;
|
|
|
|
gint nreturn_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp-text-layer-set-hinting",
|
|
|
|
&nreturn_vals,
|
|
|
|
GIMP_PDB_LAYER, layer_ID,
|
|
|
|
GIMP_PDB_INT32, hinting,
|
|
|
|
GIMP_PDB_INT32, autohint,
|
|
|
|
GIMP_PDB_END);
|
|
|
|
|
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|