## gimptextlayer

gimptextlayer — Functions for querying and manipulating text layers.

## Functions

gint32 | gimp_text_layer_new ()
gchar * | gimp_text_layer_get_text ()
gboolean | gimp_text_layer_set_text ()
gchar * | gimp_text_layer_get_markup ()
gchar * | gimp_text_layer_get_font ()
gboolean | gimp_text_layer_set_font ()
gdouble | gimp_text_layer_get_font_size ()
gboolean | gimp_text_layer_set_font_size ()
gboolean | gimp_text_layer_get_hinting ()
gboolean | gimp_text_layer_set_hinting ()
gboolean | gimp_text_layer_get_antialias ()
gboolean | gimp_text_layer_set_antialias ()
gboolean | gimp_text_layer_get_kerning ()
gboolean | gimp_text_layer_set_kerning ()
gchar * | gimp_text_layer_get_language ()
gboolean | gimp_text_layer_set_language ()
GimpTextDirection | gimp_text_layer_get_base_direction ()
gboolean | gimp_text_layer_set_base_direction ()
GimpTextJustification | gimp_text_layer_get_justification ()
gboolean | gimp_text_layer_set_justification ()
gboolean | gimp_text_layer_get_color ()
gboolean | gimp_text_layer_set_color ()
gdouble | gimp_text_layer_get_indent ()
gboolean | gimp_text_layer_set_indent ()
gdouble | gimp_text_layer_get_line_spacing ()
gboolean | gimp_text_layer_set_line_spacing ()
gdouble | gimp_text_layer_get_letter_spacing ()
gboolean | gimp_text_layer_set_letter_spacing ()
GimpTextHintStyle | gimp_text_layer_get_hint_style ()
gboolean | gimp_text_layer_set_hint_style ()
gboolean | gimp_text_layer_resize ()

## Description

Functions for querying and manipulating text layers.

## Functions

### gimp_text_layer_new ()

    gint32
    gimp_text_layer_new (gint32 image_ID,
                         const gchar *text,
                         const gchar *fontname,
                         gdouble size,
                         GimpUnit unit);

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_insert_layer()`.

#### Parameters

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. |

#### Returns

The new text layer.

Since: 2.6

### gimp_text_layer_get_text ()

    gchar *
    gimp_text_layer_get_text (gint32 layer_ID);

Get the text from a text layer as string.

This procedure returns the text from a text layer as a string.

#### Parameters

layer_ID | The text layer. |

#### Returns

The text from the specified text layer.

Since: 2.6

### gimp_text_layer_set_text ()

    gboolean
    gimp_text_layer_set_text (gint32 layer_ID,
                              const gchar *text);

Set the text of a text layer.

This procedure changes the text of a text layer.

#### Parameters

layer_ID | The text layer. |
text | The new text to set. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_markup ()

    gchar *
    gimp_text_layer_get_markup (gint32 layer_ID);

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 http://www.pango.org/ for more information about Pango and its markup. Note: Setting the markup of a text layer using Pango's markup is not supported for now.

#### Parameters

layer_ID | The text layer. |

#### Returns

The markup which represents the style of the specified text layer.

Since: 2.8

### gimp_text_layer_get_font ()

    gchar *
    gimp_text_layer_get_font (gint32 layer_ID);

Get the font from a text layer as string.

This procedure returns the name of the font from a text layer.

#### Parameters

layer_ID | The text layer. |

#### Returns

The font which is used in the specified text layer.

Since: 2.6

### gimp_text_layer_set_font ()

    gboolean
    gimp_text_layer_set_font (gint32 layer_ID,
                              const gchar *font);

Set the font of a text layer.

This procedure modifies the font used in the specified text layer.

#### Parameters

layer_ID | The text layer. |
font | The new font to use. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_font_size ()

    gdouble
    gimp_text_layer_get_font_size (gint32 layer_ID,
                                   GimpUnit *unit);

Get the font size from a text layer.

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.

#### Parameters

layer_ID | The text layer. |
unit | The unit used for the font size. |

#### Returns

The font size.

Since: 2.6

### gimp_text_layer_set_font_size ()

    gboolean
    gimp_text_layer_set_font_size (gint32 layer_ID,
                                   gdouble font_size,
                                   GimpUnit unit);

Set the font size.

This procedure changes the font size of a text layer. The size of your font will be a double 'font-size' of 'unit' units.

#### Parameters

layer_ID | The text layer. |
font_size | The font size. |
unit | The unit to use for the font size. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_hinting ()

    gboolean
    gimp_text_layer_get_hinting (gint32 layer_ID,
                                 gboolean *autohint);

`gimp_text_layer_get_hinting` is deprecated and should not be used in newly-written code.

Use `gimp_text_layer_get_hint_style()` instead.

#### Parameters

layer_ID | The text layer. |
autohint | A flag which is true if the text layer is forced to use the autohinter from FreeType. |

#### Returns

A flag which is true if hinting is used on the font.

### gimp_text_layer_set_hinting ()

    gboolean
    gimp_text_layer_set_hinting (gint32 layer_ID,
                                 gboolean hinting,
                                 gboolean autohint);

`gimp_text_layer_set_hinting` is deprecated and should not be used in newly-written code.

Use `gimp_text_layer_set_hint_style()` instead.

#### Parameters

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. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_antialias ()

    gboolean
    gimp_text_layer_get_antialias (gint32 layer_ID);

Check if antialiasing is used in the text layer.

This procedure checks if antialiasing is enabled in the specified text layer.

#### Parameters

layer_ID | The text layer. |

#### Returns

A flag which is true if antialiasing is used for rendering the font in the text layer.

Since: 2.6

### gimp_text_layer_set_antialias ()

    gboolean
    gimp_text_layer_set_antialias (gint32 layer_ID,
                                   gboolean antialias);

Enable/disable anti-aliasing in a text layer.

This procedure enables or disables anti-aliasing of the text in a text layer.

#### Parameters

layer_ID | The text layer. |
antialias | Enable/disable antialiasing of the text. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_kerning ()

    gboolean
    gimp_text_layer_get_kerning (gint32 layer_ID);

Check if kerning is used in the text layer.

This procedure checks if kerning is enabled in the specified text layer.

#### Parameters

layer_ID | The text layer. |

#### Returns

A flag which is true if kerning is used in the text layer.

Since: 2.6

### gimp_text_layer_set_kerning ()

    gboolean
    gimp_text_layer_set_kerning (gint32 layer_ID,
                                 gboolean kerning);

Enable/disable kerning in a text layer.

This procedure enables or disables kerning in a text layer.

#### Parameters

layer_ID | The text layer. |
kerning | Enable/disable kerning in the text. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_language ()

    gchar *
    gimp_text_layer_get_language (gint32 layer_ID);

Get the language used in the text layer.

This procedure returns the language string which is set for the text in the text layer.

#### Parameters

layer_ID | The text layer. |

#### Returns

The language used in the text layer.

Since: 2.6

### gimp_text_layer_set_language ()

    gboolean
    gimp_text_layer_set_language (gint32 layer_ID,
                                  const gchar *language);

Set the language of the text layer.

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.

#### Parameters

layer_ID | The text layer. |
language | The new language to use for the text layer. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_base_direction ()

    GimpTextDirection
    gimp_text_layer_get_base_direction (gint32 layer_ID);

Get the base direction used for rendering the text layer.

This procedure returns the base direction used for rendering the text in the text layer

#### Parameters

layer_ID | The text layer. |

#### Returns

The based direction used for the text layer.

Since: 2.6

### gimp_text_layer_set_base_direction ()

    gboolean
    gimp_text_layer_set_base_direction (gint32 layer_ID,
                                        GimpTextDirection direction);

Set the base direction in the text layer.

This procedure sets the base direction used in applying the Unicode bidirectional algorithm when rendering the text.

#### Parameters

layer_ID | The text layer. |
direction | The base direction of the text. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_justification ()

    GimpTextJustification
    gimp_text_layer_get_justification (gint32 layer_ID);

Get the text justification information of the text layer.

This procedure returns the alignment of the lines in the text layer relative to each other.

#### Parameters

layer_ID | The text layer. |

#### Returns

The justification used in the text layer.

Since: 2.6

### gimp_text_layer_set_justification ()

    gboolean
    gimp_text_layer_set_justification (gint32 layer_ID,
                                       GimpTextJustification justify);

Set the justification of the text in a text layer.

This procedure sets the alignment of the lines in the text layer relative to each other.

#### Parameters

layer_ID | The text layer. |
justify | The justification for your text. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_color ()

    gboolean
    gimp_text_layer_get_color (gint32 layer_ID,
                               GimpRGB *color);

Get the color of the text in a text layer.

This procedure returns the color of the text in a text layer.

#### Parameters

layer_ID | The text layer. |
color | The color of the text. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_set_color ()

    gboolean
    gimp_text_layer_set_color (gint32 layer_ID,
                               const GimpRGB *color);

Set the color of the text in the text layer.

This procedure sets the text color in the text layer 'layer'.

#### Parameters

layer_ID | The text layer. |
color | The color to use for the text. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_indent ()

    gdouble
    gimp_text_layer_get_indent (gint32 layer_ID);

Get the line indentation of text layer.

This procedure returns the indentation of the first line in a text layer.

#### Parameters

layer_ID | The text layer. |

#### Returns

The indentation value of the first line.

Since: 2.6

### gimp_text_layer_set_indent ()

    gboolean
    gimp_text_layer_set_indent (gint32 layer_ID,
                                gdouble indent);

Set the indentation of the first line in a text layer.

This procedure sets the indentation of the first line in the text layer.

#### Parameters

layer_ID | The text layer. |
indent | The indentation for the first line. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_line_spacing ()

    gdouble
    gimp_text_layer_get_line_spacing (gint32 layer_ID);

Get the spacing between lines of text.

This procedure returns the line-spacing between lines of text in a text layer.

#### Parameters

layer_ID | The text layer. |

#### Returns

The line-spacing value.

Since: 2.6

### gimp_text_layer_set_line_spacing ()

    gboolean
    gimp_text_layer_set_line_spacing (gint32 layer_ID,
                                      gdouble line_spacing);

Adjust the line spacing in a text layer.

This procedure sets the additional spacing used between lines a text layer.

#### Parameters

layer_ID | The text layer. |
line_spacing | The additional line spacing to use. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_letter_spacing ()

    gdouble
    gimp_text_layer_get_letter_spacing (gint32 layer_ID);

Get the letter spacing used in a text layer.

This procedure returns the additional spacing between the single glyphs in a text layer.

#### Parameters

layer_ID | The text layer. |

#### Returns

The letter-spacing value.

Since: 2.6

### gimp_text_layer_set_letter_spacing ()

    gboolean
    gimp_text_layer_set_letter_spacing (gint32 layer_ID,
                                        gdouble letter_spacing);

Adjust the letter spacing in a text layer.

This procedure sets the additional spacing between the single glyphs in a text layer.

#### Parameters

layer_ID | The text layer. |
letter_spacing | The additional letter spacing to use. |

#### Returns

TRUE on success.

Since: 2.6

### gimp_text_layer_get_hint_style ()

    GimpTextHintStyle
    gimp_text_layer_get_hint_style (gint32 layer_ID);

Get information about hinting in the specified text layer.

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.

#### Parameters

layer_ID | The text layer. |

#### Returns

The hint style used for font outlines.

Since: 2.8

### gimp_text_layer_set_hint_style ()

    gboolean
    gimp_text_layer_set_hint_style (gint32 layer_ID,
                                    GimpTextHintStyle style);

Control how font outlines are hinted in a text layer.

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.

#### Parameters

layer_ID | The text layer. |
style | The new hint style. |

#### Returns

TRUE on success.

Since: 2.8

### gimp_text_layer_resize ()

    gboolean
    gimp_text_layer_resize (gint32 layer_ID,
                            gdouble width,
                            gdouble height);

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.

#### Parameters

layer_ID | The text layer. |
width | The new box width in pixels. |
height | The new box height in pixels. |

#### Returns

TRUE on success.

Since: 2.8

## Types and Values