void DMDFrame::drawString(int x, int y, const String &str, DMDGraphicsMode mode, const uint8_t *font) { if(!font) font = this->font; if (x >= (int)pixel_width() || y >= (int)pixel_height()) return; _drawString(this, x, y, str, mode, font); }
void DMDFrame::drawString(int x, int y, const char *bChars, DMDGraphicsMode mode, const uint8_t *font) { if(!font) font = this->font; if (x >= (int)width || y >= height) return; _drawString(this, x, y, bChars, mode, font); }
void DMDFrame::drawString(int x, int y, const char *bChars, bool inverse, const uint8_t *font) { if(!font) font = this->font; if (x >= (int)pixel_width() || y >= (int)pixel_height()) return; _drawString(this, x, y, bChars, inverse, font); }
void DMDFrame::drawString_P(int x, int y, const char *flashStr, DMDGraphicsMode mode, const uint8_t *font) { if(!font) font = this->font; if(x >= (int)pixel_width() || y >= (int)pixel_height()) return; _FlashStringWrapper wrapper(flashStr); _drawString(this, x, y, wrapper, mode, font); }
void HelloWorld::_drawStringCentered(const GC& gc, const char* str, int x, int y, int w, int h) { int direction, ascent, descent; XCharStruct strDimensions; XTextExtents(XQueryFont(_display, XGContextFromGC(gc)), str, strlen(str), &direction, &ascent, &descent, &strDimensions); int newX = x + (w - strDimensions.width) / 2; int newY = y + (h + strDimensions.ascent - strDimensions.descent) / 2; _drawString(gc, str, newX, newY); }
void OLED::drawString_P(int x, int y, const char *str, OLED_Colour foreground, OLED_Colour background) { _FlashStringWrapper wrapper(str); _drawString(this, (void*)this->font, x, y, wrapper, foreground, background); }
void OLED::drawString(int x, int y, const String &str, OLED_Colour foreground, OLED_Colour background) { _drawString(this, (void*)this->font, x, y, str, foreground, background); }
void OLED::drawString(int x, int y, const char *bChars, OLED_Colour foreground, OLED_Colour background) { _drawString(this, (void*)this->font, x, y, bChars, foreground, background); }