Declaration [src]

gnt_util_onscreen_fit_string (
  const char* string,
  int maxw

Description [src]

Inserts newlines in ‘string’ where necessary so that its onscreen width is no more than ‘maxw’.


string const char*

The string.

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

The width that the string should fit into. If maxw is <= 0, then the available maximum width is used.

Return value

Returns: char*

A newly allocated string that needs to be freed by the caller.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The value is a NUL terminated UTF-8 string.