### Method

# Pango Layoutset_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`

  Type: `const char*`

  The text.

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

`length`

  Type: `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.