Gimp.TextLayer.new
Description: Reference for Gimp.TextLayer.new

### Constructor

# Gimp TextLayernew

since: 3.0

#### Declaration [src]

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

#### Description [src]

Create a new 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 `fontname`, `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()` command. Other attributes such as layer mask modes, and offsets should be set with explicit procedure calls.

Available since: 3.0

#### Parameters

`image`

  Type: `GimpImage`

  The image to which to add the layer.

  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 name of the font.

  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 newly created text layer. The object belongs to libgimp and you should not free it.

The data is owned by the called function.