adafruit / Adafruit_HX8357_Library

Arduino library for HX8357
43 stars 37 forks source link

Font color background no longer acceptable work around #38

Closed DJDevon3 closed 4 years ago

DJDevon3 commented 4 years ago

Font color work around using solid font background for refreshing dynamic character data only works on solid color background. tft.setTextColor(HX8357_RED, HX8357_BLACK); tft.setCursor(0, 40); tft.setTextSize(3); tft.println("Temp: ");

As you likely know without the background color present the character data will just overwrite itself until you're left with a solid filled in block. However when specifying a background color the character clears the background and redraws itself fine.

Now that TFT's are getting larger for Arduinos, processors are getting faster, we can finally add wallpaper backgrounds. The way fonts were displayed worked well in the past because people used solid color backgrounds on the entire TFT. Now that wallpapers can be used we really need a font update that doesn't require a background color to display correctly.

DJDevon3_BLE_Weatherstation_Character_BGColor

ladyada commented 4 years ago

youcould use circuitpython displayio OR littlevgl, this library does not have dynamic background redrawing capability

PaintYourDragon commented 4 years ago

Use GFXcanvas16 to create offscreen images, render into that, copy to display with drawRGBBitmap(). This is the Official And Canonical Way of handling it in GFX lib, which is simply a passive framebuffer and doesn’t abstractify graphical elements (like the aforementioned DisplayIO or LittlevGL, the latter produces really nice antialiased text, check it out). Relying on background color to overwrite text is a Fundamentally Bad Idea in a world of proportionally-spaced fonts and I wish people would avoid using that as a crutch, it’s not a VIC-20. The background color functionality only remains in the library to maintain compatibility with older code.