2008-04-02 20:53:51 +00:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimptextlayer_pdb.h
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2008-04-02 20:53:51 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-17 22:28:01 +00:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2008-04-02 20:53:51 +00: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-17 22:28:01 +00:00
|
|
|
* License along with this library. If not, see
|
2018-07-11 23:27:07 +02:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2008-04-02 20:53:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
|
|
|
|
2011-04-28 19:59:52 +02:00
|
|
|
#if !defined (__GIMP_H_INSIDE__) && !defined (GIMP_COMPILATION)
|
|
|
|
#error "Only <libgimp/gimp.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2008-04-02 20:53:51 +00:00
|
|
|
#ifndef __GIMP_TEXT_LAYER_PDB_H__
|
|
|
|
#define __GIMP_TEXT_LAYER_PDB_H__
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
/* For information look into the C source or the html documentation */
|
|
|
|
|
|
|
|
|
2022-09-30 16:21:47 +02:00
|
|
|
G_GNUC_INTERNAL GimpTextLayer* _gimp_text_layer_new (GimpImage *image,
|
|
|
|
const gchar *text,
|
2023-09-13 19:24:10 +02:00
|
|
|
GimpFont *font,
|
2022-09-30 16:21:47 +02:00
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit);
|
|
|
|
gchar* gimp_text_layer_get_text (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_text (GimpTextLayer *layer,
|
|
|
|
const gchar *text);
|
|
|
|
gchar* gimp_text_layer_get_markup (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_markup (GimpTextLayer *layer,
|
|
|
|
const gchar *markup);
|
2023-09-13 19:13:51 +02:00
|
|
|
GimpFont* gimp_text_layer_get_font (GimpTextLayer *layer);
|
2022-09-30 16:21:47 +02:00
|
|
|
gboolean gimp_text_layer_set_font (GimpTextLayer *layer,
|
2023-09-13 19:13:51 +02:00
|
|
|
GimpFont *font);
|
2022-09-30 16:21:47 +02:00
|
|
|
gdouble gimp_text_layer_get_font_size (GimpTextLayer *layer,
|
|
|
|
GimpUnit *unit);
|
|
|
|
gboolean gimp_text_layer_set_font_size (GimpTextLayer *layer,
|
|
|
|
gdouble font_size,
|
|
|
|
GimpUnit unit);
|
|
|
|
gboolean gimp_text_layer_get_antialias (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_antialias (GimpTextLayer *layer,
|
|
|
|
gboolean antialias);
|
|
|
|
GimpTextHintStyle gimp_text_layer_get_hint_style (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_hint_style (GimpTextLayer *layer,
|
|
|
|
GimpTextHintStyle style);
|
|
|
|
gboolean gimp_text_layer_get_kerning (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_kerning (GimpTextLayer *layer,
|
|
|
|
gboolean kerning);
|
|
|
|
gchar* gimp_text_layer_get_language (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_language (GimpTextLayer *layer,
|
|
|
|
const gchar *language);
|
|
|
|
GimpTextDirection gimp_text_layer_get_base_direction (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_base_direction (GimpTextLayer *layer,
|
|
|
|
GimpTextDirection direction);
|
|
|
|
GimpTextJustification gimp_text_layer_get_justification (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_justification (GimpTextLayer *layer,
|
|
|
|
GimpTextJustification justify);
|
app, libgimp, pdb, plug-ins: GimpText* using GeglColor.
One of the big improvement in this commit is that text layers are now much
better at space accuracy. They were already space-aware, yet rendered as sRGB u8
only before being converted to the image's space. It means that text layers had
the following limitations:
* Any color out of sRGB gamut were trimmed.
* Precision was always 8-bit (even if the image was high-bit depth).
Now GimpTextLayout keeps track of its source space (for RGB and CMYK only, this
won't be as easy when we will support more backend, since Cairo has only RGB
support for image data) and the image TRC (in case it bypasses the color space's
TRB) and it draws within this gamut and space.
It means first that we are not limited to sRGB colors; we will draw text main
color in the full image gamut, with still 2 remaining limitations:
* Unbounded colors are impossible because Pango format (to color text) uses
hexadecimal (so even with half/float images, you can't draw out-of-gamut text
unfortunately).
* Main color precision is still 8-bit, yet a tiny bit better than before as we
at least follow TRC (so we avoid some of the precision loss when converting,
even though the bit-depth is still the biggest loss).
The outline color on the other hand is drawn through Cairo API entirely, in
float. This means that the outline color will now be without any precision loss.
Note that this depends on CAIRO_FORMAT_RGBA128F which is only available since
Cairo 1.17.2 which is not in Debian bookworm (our current baseline for GIMP
3.0). It means that the old precision will still happen with older Cairo
version, as determined by #if code at compilation.
2023-11-17 22:36:31 +01:00
|
|
|
GeglColor* gimp_text_layer_get_color (GimpTextLayer *layer);
|
2022-09-30 16:21:47 +02:00
|
|
|
gboolean gimp_text_layer_set_color (GimpTextLayer *layer,
|
2024-03-05 01:42:22 +00:00
|
|
|
GeglColor *color);
|
2022-09-30 16:21:47 +02:00
|
|
|
gdouble gimp_text_layer_get_indent (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_indent (GimpTextLayer *layer,
|
|
|
|
gdouble indent);
|
|
|
|
gdouble gimp_text_layer_get_line_spacing (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_line_spacing (GimpTextLayer *layer,
|
|
|
|
gdouble line_spacing);
|
|
|
|
gdouble gimp_text_layer_get_letter_spacing (GimpTextLayer *layer);
|
|
|
|
gboolean gimp_text_layer_set_letter_spacing (GimpTextLayer *layer,
|
|
|
|
gdouble letter_spacing);
|
|
|
|
gboolean gimp_text_layer_resize (GimpTextLayer *layer,
|
|
|
|
gdouble width,
|
|
|
|
gdouble height);
|
2019-08-12 18:00:44 +02:00
|
|
|
|
2008-04-02 20:53:51 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GIMP_TEXT_LAYER_PDB_H__ */
|