BeRTOS
|
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 | |
| |
#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 | |
| |
#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. |
Text graphic routines (interface)
void text_moveTo | ( | struct Bitmap * | bm, |
int | row, | ||
int | col | ||
) |
uint8_t text_style | ( | struct Bitmap * | bm, |
uint8_t | flags, | ||
uint8_t | mask | ||
) |
Set/clear algorithmic font style bits.
bm | Pointer to Bitmap to affect. |
flags | Style flags to set |
mask | Mask of flags to modify |
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);