Didn't even notice there was a fourth parameter in the GLCDPrint command. 😯
It works in a way, but look at the attached image, there are some spaces between each character that are not inverted.
I would be very happy to get it fixed. I am working on a control where you can change parameters for 4-20mA sensor input with an encoder and here it will be easy to see when the selected parameter is displayed inverted.
Many thanks in advance!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Attached is an updated library. You should update your existing library with this new version. See folder GCSTUDIO\GCBASIC\INCLUDE
The new library implements the following.
Support for inverted text
Support for GLCD_OLED_FONTS
Support to GLCD character width management
These changes bring the control of the GLCD characters to the same level of control as the ILI9341 and others.
Example code used.
#DEFINE GLCD_OLED_FONT // Define this constant to use GLCD_OLED_FONT, GLCD_OLED_FONTs are smaller, faster and variable width characters, see the HELP.#IFNDEF GLCD_OLED_FONT//Optionally,pullGCBASICcharacterstighter,defaultis7forlegacyGLCDfonts.//GLCDFontWidth=6#ENDIF//Normal/defaultGLCDBackground=0GLCDForeground=1GLCDPrint(0,0,"GCBASIC")//InvertedGLCDBackground=1GLCDForeground=0GLCDPrint(0,8,"GCBASIC")//Willshownothing...asGLCDBackgroundissameascolorparameterpassed.GLCDBackground=0GLCDForeground=1GLCDPrint(0,16,"GCBASIC",0)//NormalbutusingcolorparemeterGLCDBackground=0GLCDForeground=1GLCDPrint(0,24,"GCBASIC",1)//InvertedbutusingcolorparameterGLCDBackground=1GLCDForeground=0GLCDPrint(0,32,"GCBASIC",0)//Willshowwhitecharsandwhitebackground...asGLCDBackgroundissameascolorparameterpassed.GLCDBackground=1GLCDForeground=0GLCDPrint(0,40,"GCBASIC",1)
Hi,
I am trying to invert a text string on my SH-1106 display.
Tried with this code:
But only the first letter R in Rotary is inverted.
What am I doing wrong?
Pass the background color as the 4th parameter. Does that resolve?
Thank you very much for your answer Anobium.
Didn't even notice there was a fourth parameter in the GLCDPrint command. 😯
It works in a way, but look at the attached image, there are some spaces between each character that are not inverted.
Looks like this GLCD library needs a quick fix.
From my scan of the 1106 library.
- The space character is not inverted
- The background support is not correct
- No support for OLED fonts.
Joe the author has not touched this is many years.
I can update over the next few days. If you want it fixing.
Meanwhile... write the text in normal mode... and draw a box around the 'text'
Evan
Thanks for the lightning fast reply.
I would be very happy to get it fixed. I am working on a control where you can change parameters for 4-20mA sensor input with an encoder and here it will be easy to see when the selected parameter is displayed inverted.
Many thanks in advance!
Give me a day or two.
Assume it is working in Program and I will release a fix ASAP. So, you can press on.
meanwhile... draw a filledbox() then GLCDprint into that box. Does that workaround?
That sounds great.
Ohh yes, filledbox works fine as a temporary workaround.
OK. I will post again, soon. With a updated/replacement library.
@Gert.
Attached is an updated library. You should update your existing library with this new version. See folder GCSTUDIO\GCBASIC\INCLUDE
The new library implements the following.
Support for inverted text
Support for GLCD_OLED_FONTS
Support to GLCD character width management
These changes bring the control of the GLCD characters to the same level of control as the ILI9341 and others.
Example code used.
Last edit: Anobium 2025-03-26
@Anobium
This is great! I will update the library and start using it.
Thank you very much!!