text.c File Reference

Text graphic routines. More...

#include <gfx/gfx.h>
#include <gfx/font.h>
#include <gfx/text.h>
#include <gfx/gfx_p.h>
#include <cfg/debug.h>

Go to the source code of this file.


Functions

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

Variables

static bool ansi_mode = false
 ANSI escape sequences flag: true for ESC state on.

Detailed Description

Text graphic routines.

Version:
Id
text.c 2506 2009-04-15 08:29:07Z duplo
Author:
Bernie Innocenti <bernie@codewiz.org>

Stefano Fedrigo <aleph@develer.com>

Definition in file text.c.


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


Variable Documentation

bool ansi_mode = false [static]

ANSI escape sequences flag: true for ESC state on.

Definition at line 55 of file text.c.