Gimp.text_layer_new

function text_layer_new(image: Gimp.Image, text: String, fontname: String, size: Number(gdouble), unit: Gimp.Unit): Gimp.Layer {
    // Gjs wrapper for gimp_text_layer_new()
}
  

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

Since 2.6

image

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.