### Constructor

# Gimp TextLayer new

since: 2.6

#### Declaration [src]

    GimpTextLayer*
    gimp_text_layer_new (
      GimpImage* image,
      const gchar* text,
      GimpFont* font,
      gdouble size,
      GimpUnit* unit
    )

#### Description [src]

Creates a new text layer.

This procedure creates a new text layer displaying the specified `text`. By default the width and height of the layer will be determined by the `text` contents, the `font`, `size` and `unit`.

The new layer still needs to be added to the image as this is not automatic. Add the new layer with the `gimp_image_insert_layer()` method.

The arguments are kept as simple as necessary for the basic case. All text attributes, however, can be modified with the appropriate `gimp_text_layer_set_*()` procedures.

Available since: 2.6

#### Parameters

`image`

  Type: `GimpImage`

  The image.

  The data is owned by the caller of the function.

`text`

  Type: `const gchar*`

  The text to generate (in UTF-8 encoding).

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`font`

  Type: `GimpFont`

  The font to write the text with.

  The data is owned by the caller of the function.

`size`

  Type: `gdouble`

  The size of text in either pixels or points.

`unit`

  Type: `GimpUnit`

  The units of specified size.

  The data is owned by the caller of the function.

#### Return value

Type: `GimpTextLayer`

         The new text layer. The object belongs to libgimp and you should not free it.

The data is owned by the called function.