62 uint32_t drawnElements = 0;
72 fontIdx = (myChar -
'0');
80 fontIdx = myChar -
' ';
96 currentRow = pPixMap8[fontIdx];
100 currentRow = pPixMap16[fontIdx];
104 currentRow = pPixMap32[fontIdx];
107 for (xOffset = 0; xOffset < pContext->
font.
fontWidth; ++xOffset) {
109 if (currentRow & 0x1) {
112 if (status ==
GLIB_OK) drawnElements++;
118 if (status ==
GLIB_OK) drawnElements++;
129 if (status ==
GLIB_OK) drawnElements++;
167 int32_t x0, int32_t y0,
bool opaque)
170 uint32_t drawnElements = 0;
171 uint32_t stringIndex;
175 if (pContext == NULL || pString == NULL) {
187 for (stringIndex = 0; stringIndex < sLength; stringIndex++)
190 if (pString[stringIndex] ==
'\n') {
197 status =
GLIB_drawChar(pContext, pString[stringIndex], x, y, opaque);
199 if (status ==
GLIB_OK) drawnElements++;
226 if (pContext == NULL) {
#define GLIB_ERROR_NOTHING_TO_DRAW
Font definition structure.
#define GLIB_ERROR_INVALID_ARGUMENT
uint16_t cntOfMapElements
EMSTATUS GLIB_drawString(GLIB_Context_t *pContext, const char *pString, uint32_t sLength, int32_t x0, int32_t y0, bool opaque)
Draws a string using the font supplied with the library.
Silicon Labs Graphics Library.
#define GLIB_ERROR_INVALID_CHAR
EMSTATUS GLIB_drawPixelColor(GLIB_Context_t *pContext, int32_t x, int32_t y, uint32_t color)
Draws a pixel at x, y using the color parameter.
EMSTATUS GLIB_drawPixel(GLIB_Context_t *pContext, int32_t x, int32_t y)
Draws a pixel at x, y using foregroundColor defined in the GLIB_Context_t.
Silicon Labs Graphics Library: Color Defines.
EMSTATUS GLIB_setFont(GLIB_Context_t *pContext, GLIB_Font_t *pFont)
Set new font for the library. Note that GLIB defines a default font in glib.c. Redefine GLIB_DEFAULT_...
EMSTATUS GLIB_drawChar(GLIB_Context_t *pContext, char myChar, int32_t x, int32_t y, bool opaque)
Draws a char using the font supplied with the library.
GLIB Drawing Context (Multiple instances of GLIB_Context_t can exist)