Pango.Layout.set_text
Description: Reference for Pango.Layout.set_text

### Method

# Pango.Layout.set_text

#### Declaration [src]

    void
    pango_layout_set_text (
      PangoLayout* layout,
      const char* text,
      int length
    )

#### Description [src]

Sets the text of the layout.

This function validates `text` and renders invalid UTF-8 with a placeholder glyph.

Note that if you have used `pango_layout_set_markup()` or `pango_layout_set_markup_with_accel()` on `layout` before, you may want to call `pango_layout_set_attributes()` to clear the attributes set on the layout from the markup as this function does not clear attributes.

#### Parameters

`text` | `const char*`
| the text
| Ownership is not transferred to the callee
| The string is a NUL terminated UTF-8 string
`length` | `int`
| maximum length of `text`, in bytes. -1 indicates that the string is nul-terminated and the length should be calculated. The text will also be truncated on encountering a nul-termination even when `length` is positive.