libtcod
Loading...
Searching...
No Matches
Printing (Deprecated)

Deprecated printing functions without full support for UTF-8 or Unicode. More...

Functions

void TCOD_console_print (TCOD_Console *con, int x, int y, const char *fmt,...)
 Print an EASCII string on a console, using default colors and alignment.
void TCOD_console_print_ex (TCOD_Console *con, int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt,...)
 Print an EASCII string on a console, using default colors.
int TCOD_console_print_rect (TCOD_Console *con, int x, int y, int w, int h, const char *fmt,...)
 Print an EASCII string on a console constrained to a rectangle, using default colors and alignment.
int TCOD_console_print_rect_ex (TCOD_Console *con, int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt,...)
 Print an EASCII string on a console constrained to a rectangle, using default colors.
void TCOD_console_print_frame (TCOD_console_t con, int x, int y, int w, int h, bool empty, TCOD_bkgnd_flag_t flag, const char *fmt,...)
 Print an EASCII titled, framed region on a console, using default colors and alignment.
int TCOD_console_get_height_rect (TCOD_Console *con, int x, int y, int w, int h, const char *fmt,...)
 Return the number of lines that would be printed by an EASCII string.
void TCOD_console_print_utf (TCOD_Console *con, int x, int y, const wchar_t *fmt,...)
void TCOD_console_print_ex_utf (TCOD_Console *con, int x, int y, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt,...)
int TCOD_console_print_rect_utf (TCOD_Console *con, int x, int y, int w, int h, const wchar_t *fmt,...)
int TCOD_console_print_rect_ex_utf (TCOD_Console *con, int x, int y, int w, int h, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const wchar_t *fmt,...)
int TCOD_console_get_height_rect_utf (TCOD_Console *con, int x, int y, int w, int h, const wchar_t *fmt,...)

Detailed Description

Deprecated printing functions without full support for UTF-8 or Unicode.

None of these functions support the full range of Unicode characters. Printing (Unicode) should be used instead.

Functions taking basic char strings only support EASCII codepoints. Providing UTF-8 strings to these functions will result in garbage.

Despite the _utf postfix the wchar_t functions do not handle variable length characters as you'd expect from UTF-16. They only support full Unicode when the platform has a 4 byte wchar_t. A 2 byte wchar_t acts like UCS-2.

Function Documentation

◆ TCOD_console_get_height_rect()

int TCOD_console_get_height_rect ( TCOD_Console * con,
int x,
int y,
int w,
int h,
const char * fmt,
... )

Return the number of lines that would be printed by an EASCII string.

Parameters
conA console pointer.
xThe starting X coordinate, the left-most position being 0.
yThe starting Y coordinate, the top-most position being 0.
wThe width of the region. If 0 then the maximum width will be used.
hThe height of the region. If 0 then the maximum height will be used.
fmtAn EASCII format string as if passed to printf.
...Variadic arguments as if passed to printf.
Returns
The number of lines that would have been printed.

◆ TCOD_console_get_height_rect_utf()

int TCOD_console_get_height_rect_utf ( TCOD_Console * con,
int x,
int y,
int w,
int h,
const wchar_t * fmt,
... )
embed:rst:leading-asterisk 
.. deprecated:: 1.8

◆ TCOD_console_print()

void TCOD_console_print ( TCOD_Console * con,
int x,
int y,
const char * fmt,
... )

Print an EASCII string on a console, using default colors and alignment.

Parameters
conA console pointer.
xThe starting X coordinate, the left-most position being 0.
yThe starting Y coordinate, the top-most position being 0.
fmtAn EASCII format string as if passed to printf.
...Variadic arguments as if passed to printf.

◆ TCOD_console_print_ex()

void TCOD_console_print_ex ( TCOD_Console * con,
int x,
int y,
TCOD_bkgnd_flag_t flag,
TCOD_alignment_t alignment,
const char * fmt,
... )

Print an EASCII string on a console, using default colors.

Parameters
conA console pointer.
xThe starting X coordinate, the left-most position being 0.
yThe starting Y coordinate, the top-most position being 0.
flagThe blending flag.
alignmentThe font alignment to use.
fmtAn EASCII format string as if passed to printf.
...Variadic arguments as if passed to printf.

◆ TCOD_console_print_ex_utf()

void TCOD_console_print_ex_utf ( TCOD_Console * con,
int x,
int y,
TCOD_bkgnd_flag_t flag,
TCOD_alignment_t alignment,
const wchar_t * fmt,
... )
embed:rst:leading-asterisk 
.. deprecated:: 1.8
  Use TCOD_console_printf_ex instead.

◆ TCOD_console_print_frame()

void TCOD_console_print_frame ( TCOD_console_t con,
int x,
int y,
int w,
int h,
bool empty,
TCOD_bkgnd_flag_t flag,
const char * fmt,
... )

Print an EASCII titled, framed region on a console, using default colors and alignment.

Parameters
conA console pointer.
xThe starting X coordinate, the left-most position being 0.
yThe starting Y coordinate, the top-most position being 0.
wThe width of the frame.
hThe height of the frame.
emptyIf true the characters inside of the frame will be cleared with spaces.
flagThe blending flag.
fmtAn EASCII format string as if passed to printf.
...Variadic arguments as if passed to printf.

This function makes assumptions about the fonts character encoding and may draw garbage with some tilesets.

embed:rst:leading-asterisk 
.. deprecated:: 1.19
  This function is not using Unicode frame characters and has been deprecated.

◆ TCOD_console_print_rect()

int TCOD_console_print_rect ( TCOD_Console * con,
int x,
int y,
int w,
int h,
const char * fmt,
... )

Print an EASCII string on a console constrained to a rectangle, using default colors and alignment.

Parameters
conA console pointer.
xThe starting X coordinate, the left-most position being 0.
yThe starting Y coordinate, the top-most position being 0.
wThe width of the region. If 0 then the maximum width will be used.
hThe height of the region. If 0 then the maximum height will be used.
fmtAn EASCII format string as if passed to printf.
...Variadic arguments as if passed to printf.
Returns
The number of lines actually printed.

◆ TCOD_console_print_rect_ex()

int TCOD_console_print_rect_ex ( TCOD_Console * con,
int x,
int y,
int w,
int h,
TCOD_bkgnd_flag_t flag,
TCOD_alignment_t alignment,
const char * fmt,
... )

Print an EASCII string on a console constrained to a rectangle, using default colors.

Parameters
conA console pointer.
xThe starting X coordinate, the left-most position being 0.
yThe starting Y coordinate, the top-most position being 0.
wThe width of the region. If 0 then the maximum width will be used.
hThe height of the region. If 0 then the maximum height will be used.
flagThe blending flag.
alignmentThe font alignment to use.
fmtAn EASCII format string as if passed to printf.
...Variadic arguments as if passed to printf.
Returns
The number of lines actually printed.

◆ TCOD_console_print_rect_ex_utf()

int TCOD_console_print_rect_ex_utf ( TCOD_Console * con,
int x,
int y,
int w,
int h,
TCOD_bkgnd_flag_t flag,
TCOD_alignment_t alignment,
const wchar_t * fmt,
... )
embed:rst:leading-asterisk 
.. deprecated:: 1.8
  Use TCOD_console_printf_rect_ex instead.

◆ TCOD_console_print_rect_utf()

int TCOD_console_print_rect_utf ( TCOD_Console * con,
int x,
int y,
int w,
int h,
const wchar_t * fmt,
... )
embed:rst:leading-asterisk 
.. deprecated:: 1.8
  Use TCOD_console_printf_rect instead.

◆ TCOD_console_print_utf()

void TCOD_console_print_utf ( TCOD_Console * con,
int x,
int y,
const wchar_t * fmt,
... )
embed:rst:leading-asterisk 
.. deprecated:: 1.8
  Use TCOD_console_printf instead.