greiman / SSD1306Ascii

Text only Arduino Library for SSD1306 OLED displays
MIT License
490 stars 120 forks source link

Text height #96

Closed cvpfus closed 1 year ago

cvpfus commented 1 year ago

How to get text height just like text width? I can get the text width by using this code int textWidth = oled.strWidth("Test");

cvpfus commented 1 year ago

after reading the documentation, its impossible.. i just want to center the text horizontally and vertically.. i can center the text horizontally using calculation of text width, but i still have no idea to center the text vertically

greiman commented 1 year ago

You can only choose the row and rows are separated by eight pixels. It is a hardware property.

fontHeight() gives the height in pixels but you can not truly center a line vertically since the display hardware is only row, eight pixel, addressable.