text.h File Reference

Text graphic routines (interface). More...

#include <cfg/compiler.h>
#include <cfg/macros.h>
#include <cpu/attr.h>
#include <gfx/gfx.h>
#include <stdarg.h>

Go to the source code of this file.


Defines

#define ANSI_ESC_CLEARSCREEN   'c'
 Escape sequences codes.
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.

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.

Detailed Description

Text graphic routines (interface).

Author:
Bernie Innocenti <bernie@codewiz.org>

Stefano Fedrigo <aleph@develer.com>

Version:
Id
text.h 1740 2008-08-27 17:27:57Z batt

Definition in file text.h.


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 72 of file text.c.

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

Set/clear algorithmic font style bits.

Parameters:
bm Pointer to Bitmap to affect.
flags Style flags to set
mask Mask 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 317 of file text.c.