diff --git a/SSD1306.h b/SSD1306.h index ee9a7b8041c5576b48246766ddfabf9d7db85483..76a5b31f0b748d30e4c239373b4684b7b545fdd6 100644 --- a/SSD1306.h +++ b/SSD1306.h @@ -188,6 +188,10 @@ class SSD1306 { // The text will be wrapped to the next line at a space or dash void drawStringMaxWidth(int16_t x, int16_t y, uint16_t maxLineWidth, String text); + // Returns the width of the const char* with the current + // font settings + uint16_t getStringWidth(const char* text, uint16_t length); + // Specifies relative to which anchor point // the text is rendered. Available constants: // TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER_BOTH