3 * Copyright (C) 1999 Bernardo Innocenti <bernie@develer.com>
4 * Copyright (C) 2003 Develer S.r.l. (http://www.develer.com/)
9 * \author Bernardo Innocenti <bernie@develer.com>
10 * \author Stefano Fedrigo <aleph@develer.com>
12 * \brief Text graphic routines
17 * Revision 1.1 2004/05/23 15:43:16 bernie
18 * Import mware modules.
20 * Revision 1.9 2004/04/03 20:42:49 aleph
23 * Revision 1.8 2004/03/19 16:52:28 bernie
24 * Move printf() like functions from text.c to text_format.c and add PROGMEM versions.
26 * Revision 1.7 2004/03/17 17:30:30 bernie
27 * Add GCC format checks to printf()-like functions.
29 * Revision 1.6 2004/02/21 21:40:20 aleph
32 * Revision 1.5 2004/02/18 11:50:10 aleph
33 * Add right alignment to xprintf
35 * Revision 1.4 2004/01/13 12:15:28 aleph
36 * Move font table in program memory; add font.h
38 * Revision 1.3 2004/01/13 00:06:47 aleph
39 * Fix clipping and ANSI esc bug, add text_xprintf()
41 * Revision 1.2 2004/01/08 18:03:12 aleph
42 * Add text functions to set coordinates
44 * Revision 1.1 2004/01/07 23:31:54 aleph
56 #define STYLEF_BOLD BV(0)
57 #define STYLEF_ITALIC BV(1)
58 #define STYLEF_UNDERLINE BV(2)
59 #define STYLEF_INVERT BV(3)
60 #define STYLEF_EXPANDED BV(4)
61 #define STYLEF_CONDENSED BV(5)
62 #define STYLEF_STRIKEOUT BV(6) /* Not implemented */
65 (STYLEF_BOLD | STYLEF_ITALIC | STYLEF_UNDERLINE | \
66 STYLEF_EXPANDED | STYLEF_CONDENSED | STYLEF_INVERT)
68 /* Flags for text_xprintf() */
69 #define TEXT_NORMAL 0 /*!< Normal mode */
70 #define TEXT_FILL BV(0) /*!< Fill rest of line with spaces */
71 #define TEXT_CENTER BV(1) /*!< Center string in line */
72 #define TEXT_INVERT BV(2) /*!< Inverted mode */
73 #define TEXT_RIGHT BV(3) /*!< Right aligned */
75 /* Escape sequences codes */
76 #define ANSI_ESC_CLEARSCREEN 'c'
83 void text_moveto(struct Bitmap *bm, int row, int col);
84 void text_setcoord(struct Bitmap *bm, int x, int y);
85 int text_putchar(char c, struct Bitmap *bm);
86 int text_puts(const char *str, struct Bitmap *bm);
87 int text_vprintf(struct Bitmap *bm, const char *fmt, va_list ap);
88 int text_printf(struct Bitmap *bm, const char *fmt, ...) FORMAT(__printf__, 2, 3);
89 int text_xprintf(struct Bitmap *bm, uint8_t row, uint8_t col, uint8_t mode, const char *fmt, ...) FORMAT(__printf__, 5, 6);
90 uint8_t text_style(uint8_t flags, uint8_t mask);
91 void text_clear(struct Bitmap *bm);
93 int text_puts_P(const char * PROGMEM str, struct Bitmap *bm);
94 int text_vprintf_P(struct Bitmap *bm, const char * PROGMEM fmt, va_list ap);
95 int text_printf_P(struct Bitmap *bm, const char * PROGMEM fmt, ...) FORMAT(__printf__, 2, 3);
96 int text_xprintf_P(struct Bitmap *bm, uint8_t row, uint8_t col, uint8_t mode, const char * PROGMEM fmt, ...) FORMAT(__printf__, 5, 6);