The functions for printing text are used to output text to the text frame buffer. Currently supported buffer formats are GF_ATEXT (text with color attribute) and GF_MTEXT (mono text).
|
#define | PC_BLACK 0 |
|
#define | PC_BLUE 1 |
|
#define | PC_GREEN 2 |
|
#define | PC_CYAN 3 |
|
#define | PC_RED 4 |
|
#define | PC_MAGENTA 5 |
|
#define | PC_BROWN 6 |
|
#define | PC_LTGRAY 7 |
|
#define | PC_GRAY 8 |
|
#define | PC_LTBLUE 9 |
|
#define | PC_LTGREEN 10 |
|
#define | PC_LTCYAN 11 |
|
#define | PC_LTRED 12 |
|
#define | PC_LTMAGENTA 13 |
|
#define | PC_YELLOW 14 |
|
#define | PC_WHITE 15 |
|
#define | PC_COLOR(bg, fg) (((bg)<<4)|(fg)) |
|
#define | PC_FGCOLOR(color) ((color) & 0b1111) |
|
#define | PC_BGCOLOR(color) ((color) >> 4) |
|
#define | CHAR_CR '\r' |
|
#define | CHAR_LF '\n' |
|
#define | CHAR_TAB '\t' |
|
#define | CHAR_FRAME 16 |
| Frame base.
|
|
#define | FRAME_L B0 |
| Frame left flag.
|
|
#define | FRAME_U B1 |
| Frame up flag.
|
|
#define | FRAME_R B2 |
| Frame right flag.
|
|
#define | FRAME_D B3 |
| Frame down flag.
|
|
#define | CHAR_FRAME_FIRST 17 |
| First frame character.
|
|
#define | CHAR_FRAME_LAST 31 |
| Last frame character.
|
|
#define | CHAR_VLINE (CHAR_FRAME|FRAME_U|FRAME_D) |
| Vertical line.
|
|
#define | CHAR_HLINE (CHAR_FRAME|FRAME_L|FRAME_R) |
| Horizontal line.
|
|
|
void | PrintSetup (u8 *buf, int bufw, int bufh, int bufwb) |
| Setup print service. More...
|
|
void | PrintClear () |
| Clear the text buffer with the currently selected color.
|
|
void | PrintHome () |
| Move the pointer to the beginning of the first line.
|
|
void | PrintSetPos (int x, int y) |
| Set print position. More...
|
|
void | PrintAddPos (int x, int y) |
| Shift relative print position. More...
|
|
void | PrintSetCol (u8 col) |
| Set print color (2x4 bits of colors) More...
|
|
void | PrintChar0 (char ch) |
| Print character, not using control characters. More...
|
|
void | PrintChar (char ch) |
| Print character, using control characters CR, LF, TAB. More...
|
|
void | PrintSpc () |
| Print space character.
|
|
void | PrintSpcTo (int pos) |
| Printing spaces up to the specified position. More...
|
|
void | PrintCharRep (char ch, int num) |
| Print repeated character. More...
|
|
void | PrintSpcRep (int num) |
| Print repeated space. More...
|
|
void | PrintText (const char *text) |
| Print a string. More...
|
|
void | PrintHLine (int x, int y, int w) |
| Print horizontal line into screen, using current color. More...
|
|
void | PrintVLine (int x, int y, int h) |
| Print vertical line into screen, using current color. More...
|
|
void | PrintFrame (int x, int y, int w, int h) |
| Print frame, using current color. More...
|
|
|
u8 * | PrintBuf |
|
int | PrintBufW |
|
int | PrintBufH |
|
int | PrintBufWB |
|
int | PrintX |
|
int | PrintY |
|
u8 | PrintCol |
|
◆ PrintSetup()
void PrintSetup |
( |
u8 * |
buf, |
|
|
int |
bufw, |
|
|
int |
bufh, |
|
|
int |
bufwb |
|
) |
| |
Setup print service.
Initialization of the text printing service. The function is passed a pointer to the text frame buffer and its dimensions. If the line length in bytes is less than twice the width, the mono text format GF_MTEXT is selected, otherwise the format with the GF_ATEXT attributes is used. This function is automatically called when the video mode is initialized using the Video() function.
- Parameters
-
buf | Pointer to buffer |
bufw | Buffer width in characters |
bufh | Buffer height in characters |
bufwb | Buffer width in bytes (if bufwb < 2*bufw, use mono text) |
◆ PrintSetPos()
void PrintSetPos |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Set print position.
- Parameters
-
x | Column position |
y | Row position |
◆ PrintAddPos()
void PrintAddPos |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Shift relative print position.
- Parameters
-
x | Add column position |
y | Add row position |
◆ PrintSetCol()
void PrintSetCol |
( |
u8 |
col | ) |
|
Set print color (2x4 bits of colors)
- Parameters
-
col | Color - Use the PC_COLOR macro |
◆ PrintChar0()
void PrintChar0 |
( |
char |
ch | ) |
|
Print character, not using control characters.
- Parameters
-
◆ PrintChar()
void PrintChar |
( |
char |
ch | ) |
|
Print character, using control characters CR, LF, TAB.
- Parameters
-
◆ PrintSpcTo()
void PrintSpcTo |
( |
int |
pos | ) |
|
Printing spaces up to the specified position.
- Parameters
-
◆ PrintCharRep()
void PrintCharRep |
( |
char |
ch, |
|
|
int |
num |
|
) |
| |
Print repeated character.
- Parameters
-
ch | Character |
num | Number of times to repeat |
◆ PrintSpcRep()
void PrintSpcRep |
( |
int |
num | ) |
|
Print repeated space.
- Parameters
-
num | Number of times to repeat |
◆ PrintText()
void PrintText |
( |
const char * |
text | ) |
|
Print a string.
- Parameters
-
◆ PrintHLine()
void PrintHLine |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w |
|
) |
| |
Print horizontal line into screen, using current color.
Horizontal line drawing. Line drawing characters with code 17 to 31 are used for drawing, as overridden in the PicoVGA library fonts. When drawing, the line is combined with the characters already in the print buffer so that the lines are properly joined and overlapped. The function does not treat overflows outside the allowed display range.
- Note
- Must not stretch outside valid range
- Parameters
-
x | Column position |
y | Row position |
w | Width of line |
◆ PrintVLine()
void PrintVLine |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
h |
|
) |
| |
Print vertical line into screen, using current color.
Vertical line drawing. Line drawing characters with code 17 to 31 are used for drawing, as overridden in the PicoVGA library fonts. When drawing, the line is combined with the characters already in the print buffer so that the lines are properly joined and overlapped. The function does not treat overflows outside the allowed display range.
- Note
- Must not stretch outside valid range
- Parameters
-
x | Column position |
y | Row position |
h | Height of line |
◆ PrintFrame()
void PrintFrame |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Print frame, using current color.
- Parameters
-
x | Column position |
y | Row position |
w | Width of line |
h | Height of line |