Comments (6)
Thank you for using this library π
Unfortunately, I have never used the sprite feature.
Please tell me the smallest code that can reproduce the issue in my environment.
And what microcontroller you are using.
Thank you.
from openfontrender.
Note: The full demo program for OpenFontRender library I wrote is here: https://github.com/MikeyMoMo/OpenFontRender-Example-program
I have noticed the same thing. Just throw something on screen with foreground and background colors set. The background color is ignored. If you want it, that is a very good thing -- an invisible background color not changing the background of the characters. However, if you want the background color to happen, it is not good the way it is. I am writing to two different sprites and to the base tft screen.
Here is a code snippet I wrote to check out every non-trivial call in your API listing. I posted elsewhere with other errors that came up while writing and testing this program such as text height is wrong and the bounding box is wrong.
Here, the background color setting (done 2 ways) is ignored anyway. The letters come out white on black, not red.
tft.fillScreen(TFT_BLACK);
// Alignment Left
// If the second font color is missing, it will be written invisible and the background color
// already on the screen will not be changed. To change it, use a second color like this:
render.setFontColor(TFT_WHITE, TFT_RED); // Foreground, Background (optional)
// Note, it can also be set by 8 bit hex values. Foreground only or foreground and background, as above.
// render.setFontColor(0x50, 0x70, 0x150); // Mostly blue, a little green and less red. FG only set.
// ...or...
// render.setFontColor(0x50, 0x70, 0x150, 0x150, 0x70, 0x50); // Set FG and BG to custom colors.
//
// You can also set the background color, only, thus:
render.setBackgroundColor(TFT_RED); // Change BG color only, leave font color as already set.
// So far, the background color setting does nothing. Maybe this is by design.
// Alignment left
render.setCursor(0, 0);
render.printf("Hello\nWorld size "); // Only foreground color honored.
from openfontrender.
As above. Sorry for the delay.
I can pull some code but this above looks very similar to what I have done as well.
As above it seems as though the background colour is ignored
from openfontrender.
I just uploaded my full demo code that shows this (not) happening. It also shows how to use all but the most trivial calls to this library and even shows some of the trivial ones. It is my first Github repository. Please be kind... ;-))
It is here:
There is a notation that the font BG color is not being used. I am not sure if that is in a sprite but it fails. I could do it to a sprite if necessary. I use OFR for both sprites and background (tft) screen writes and it operates the same both ways. Also under MikeyMoMo is a very full featured clock/calendar program that uses OFR for almost everything, sprites and tft writes. All works pretty well. Just a few little bugs to work out. SO glad to have this library!!!
from openfontrender.
From v1.1, you can select background fill method.
Try using the setBackgroundFillMethod()
function.
See GitHub Pages for details.
I am really sorry for the late updateπββοΈπββοΈπββοΈ
from openfontrender.
This works. The lines I used are:
scrollSprite.fillRect(trackTimeDate, 0, scrollSpriteW, scrollSpriteH, DarkBlue);
ofr.setDrawer(scrollSprite);
ofr.setFontColor(TFT_WHITE, DarkBlue);
ofr.setBackgroundFillMethod(BgFillMethod::Block);
from openfontrender.
Related Issues (20)
- If no cache is set, it defaults to CACHE_SIZE_NO_LIMIT which will consume all available (heap) memory HOT 2
- Need some way to center text on screen HOT 6
- Font height is not computed correctly -- too short HOT 2
- Cursor x resting place calculated too far right after cprintf (w/ proposed solution) HOT 1
- FreeType Cache just keeps growing HOT 3
- [OFR ERROR] FTC_Manager_LookupFace error: 0x40 HOT 2
- Feature request: output to image file HOT 3
- Feature request: text wrap HOT 1
- SdFat support? HOT 2
- Please support ARM cortex arch? HOT 2
- Feature Request: Text outline support
- Feature request: loading fonts from SPIFFS/LittleFS HOT 4
- Compilation error using "setBackgroundFillMethod" HOT 1
- How can an integer be printed without sprintf HOT 2
- Nucleo64 : undefined reference to `_open' HOT 6
- STM32H750 HOT 2
- Using SPIFFS instead of SD HOT 2
- Getting flickering with large front redraws HOT 6
- Align::*Right doesn't work quite right? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfontrender.