Method

TermboxTerminalprint_ex

Declaration

gboolean
tbg_terminal_print_ex (
  TbgTerminal* self,
  int x,
  int y,
  TbgAttr fg,
  TbgAttr bg,
  gsize* out_width,
  const char* str,
  GError** error
)

Description

Print UTF-8 text into the internal back buffer and optionally return its display width.

Non-printable characters and truncated UTF-8 byte sequences are replaced with U+FFFD. Newlines are supported and move output to the next row; out_width is the width the string would occupy on a single line.

If the starting coordinate is out of bounds, an error is returned. If the starting coordinate is in bounds but the text extends out of bounds, the out-of-bounds part is ignored.

Parameters

x

Type: int

X coordinate of the first cell.

y

Type: int

Y coordinate of the first cell.

fg

Type: TbgAttr

Foreground attribute.

bg

Type: TbgAttr

Background attribute.

out_width

Type: gsize*

Return location for printed cell width, or NULL.

The argument will be set by the function.
The argument can be NULL.
str

Type: const char*

UTF-8 text to print.

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

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE on success, or FALSE with error set.