Function

Gntutil_onscreen_fit_string

Declaration [src]

char*
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’.

Parameters

string

Type: const char*

The string.

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

Type: int

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

Return value

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