u8g2 icon indicating copy to clipboard operation
u8g2 copied to clipboard

Add feature getStrWidth() to U8G2_SSD1306_128X64_NONAME_F_HW_I2C

Open johnsmakar opened this issue 3 years ago • 6 comments

I was trying to use getStrWidth, but get...

no matching function for call to 'U8G2_SSD1306_128X64_NONAME_F_HW_I2C::getStrWidth(String)'

Can you add this feature?

johnsmakar avatar Jul 21 '21 02:07 johnsmakar

It is implemented: https://raw.githubusercontent.com/olikraus/u8g2/master/cppsrc/U8g2lib.h

and described here: https://github.com/olikraus/u8g2/wiki/u8g2reference#getstrwidth

olikraus avatar Jul 21 '21 08:07 olikraus

How come I get a no matching function error?

Note: I am using a Espressif Pico-D4

johnsmakar avatar Jul 21 '21 08:07 johnsmakar

Hmmm... I nither know your code nor do I know your environment. Do you use Arduino IDE?

olikraus avatar Jul 21 '21 09:07 olikraus

I am using the ArduinoIDE.

Is there an incorrect implementation code of code that would result with that error? Thanks in advance

johnsmakar avatar Jul 21 '21 17:07 johnsmakar

I am not aware of any issue here.

olikraus avatar Jul 21 '21 17:07 olikraus

Oh I just see, that you tried to pass a "String" object. You have to pass "string.c_str()" instead.

olikraus avatar Mar 04 '22 12:03 olikraus