Operations
[Tonc Text Engine]

Basic operations. More...

Functions

void tte_set_context (TTC *tc)
 Set the master context pointer.
INLINE TTCtte_get_context (void)
 Get the master text-system.
INLINE uint tte_get_glyph_id (int ch)
 Get the glyph index of character ch.
INLINE int tte_get_glyph_width (uint gid)
 Get the width of glyph id.
INLINE int tte_get_glyph_height (uint gid)
 Get the height of glyph id.
INLINE const void * tte_get_glyph_data (uint gid)
 Get the glyph data of glyph id.
void tte_set_color (eint type, u16 clr)
 Set color attribute of type to cattr.
void tte_set_colors (const u16 colors[])
 Load important color data.
void tte_set_color_attr (eint type, u16 cattr)
 Set color attribute of type to cattr.
void tte_set_color_attrs (const u16 cattrs[])
 Load important color attribute data.
char * tte_cmd_default (const char *str)
 Text command handler.
int tte_putc (int ch)
 Plot a single character; does wrapping too.
int tte_write (const char *text)
 Render a string.
int tte_write_ex (int x, int y, const char *text, const u16 *clrlut)
 Extended string writer, with positional and color info.
void tte_erase_rect (int left, int top, int right, int bottom)
 Erase a porttion of the screen (ignores margins).
void tte_erase_screen (void)
 Erase the screen (within the margins).
void tte_erase_line (void)
 Erase the whole line (within the margins).
POINT16 tte_get_text_size (const char *str)
 Get the size taken up by a string.
void tte_init_base (const TFont *font, fnDrawg drawProc, fnErase eraseProc)
 Base initializer of a TTC.

Detailed Description

Basic operations.

This covers most of the things you can actually use TTE for, like writing the text, getting information about a glyph and setting color attributes.


Function Documentation

char* tte_cmd_default ( const char *  str  ) 

Text command handler.

Takes commands formatted as "#{[cmd]:[opt];[[cmd]:[opt];...]} and deals with them.

Command list:

Examples:

void tte_erase_line ( void   ) 

Erase the whole line (within the margins).

Note:
Ponder: set paper color?

void tte_erase_screen ( void   ) 

Erase the screen (within the margins).

Note:
Ponder: set paper color?

POINT16 tte_get_text_size ( const char *  str  ) 

Get the size taken up by a string.

Parameters:
str String to check.
Returns:
width and height, packed into a POINT16.
Note:
This function ignores tte commands, so don't use on strings that use commands.

int tte_putc ( int  ch  ) 

Plot a single character; does wrapping too.

Parameters:
ch Character to plot (not glyph-id).
Returns:
Character width.
Note:
Overhead: ~70 cycles.

void tte_set_context ( TTC tc  ) 

Set the master context pointer.

int tte_write ( const char *  text  ) 

Render a string.

Parameters:
text String to parse and write.
Returns:
Number of parsed characters.


Generated on Mon Aug 25 17:03:57 2008 for libtonc by  doxygen 1.5.3