BeRTOS
Defines | Functions
Text handling on graphical displays.
General purpose graphical routines

Text graphic routines (interface) More...

Defines

#define ANSI_ESC_CLEARSCREEN   'c'
 Escape sequences codes.

Functions

void text_moveTo (struct Bitmap *bm, int row, int col)
 Move (imaginary) cursor to column and row specified.
void text_setCoord (struct Bitmap *bm, int x, int y)
 Move (imaginary) cursor to coordinates specified.
int text_putchar (char c, struct Bitmap *bm)
 Render char c, with (currently) limited ANSI escapes emulation support and '
' for newline.
uint8_t text_style (struct Bitmap *bm, uint8_t flags, uint8_t mask)
 Set/clear algorithmic font style bits.
void text_clear (struct Bitmap *bm)
 Clear the screen and reset cursor position.

Style flags

See also:
text_style()
#define STYLEF_BOLD   BV(0)
#define STYLEF_ITALIC   BV(1)
#define STYLEF_UNDERLINE   BV(2)
#define STYLEF_INVERT   BV(3)
#define STYLEF_EXPANDED   BV(4)
#define STYLEF_CONDENSED   BV(5)
#define STYLEF_STRIKEOUT   BV(6)
#define STYLEF_TALL   BV(7)
#define STYLEF_MASK

Formatting flags for text rendering

See also:
text_xprintf()
#define TEXT_NORMAL   0
 Normal mode.
#define TEXT_FILL   BV(13)
 Fill rest of line with spaces.
#define TEXT_CENTER   BV(14)
 Center string in line.
#define TEXT_RIGHT   BV(15)
 Right aligned.

Detailed Description

Text graphic routines (interface)

Author:
Bernie Innocenti <bernie@codewiz.org>
Stefano Fedrigo <aleph@develer.com>

Function Documentation

void text_moveTo ( struct Bitmap bm,
int  row,
int  col 
)

Move (imaginary) cursor to column and row specified.

Next text write will start a that row and col.

Definition at line 70 of file text.c.

uint8_t text_style ( struct Bitmap bm,
uint8_t  flags,
uint8_t  mask 
)

Set/clear algorithmic font style bits.

Parameters:
bmPointer to Bitmap to affect.
flagsStyle flags to set
maskMask of flags to modify
Returns:
Old style flags

Examples: Turn on bold, leave other styles alone

 text_style(bm, STYLEF_BOLD, STYLEF_BOLD); 

Turn off bold and turn on italic, leave others as they are

 text_style(bm, STYLEF_ITALIC, STYLEF_BOLD | STYLEF_ITALIC); 

Query current style without chaning it

 style = text_style(bm, 0, 0); 

Reset all styles (plain text)

 text_style(bm, 0, STYLE_MASK); 

Definition at line 315 of file text.c.