Comments (8)
I'm glad it worked out. 🎉
OpenFontRender
is currently undergoing an update process in the develop branch to make it more functional and less Arduino-dependent. (The reduction of Arduino dependencies includes moving away from Serial.)
The main code update has already been completed, and I am adding sample code and fixing documentation.
New OpenFontRender
will be released soon.
If you can, please try the develop branch at ESP-IDF and give us your feedback, it would be greatly appreciated.
Finally, in your question Is not possible to make it smaller reducing the size of the Glyph?
do you mean the drawing font size?
If so, you can change the font size with setFontSize
method.
Thank you.
from openfontrender.
Thank you for using this library! 😊
Answer to the question: it is possible but a bit difficult.
I usually use a small ttf font regenerated from a ttf font with only the characters I need.
To create this small ttf font, I use a software program called Subset Font Maker.
The reason I put "a bit difficult" in the answer to your question is that this software localized Japanese.
I think it would probably work with Chinese fonts as well, but I have not tested it.
I looked for other software with similar functionality but I could not find it.
In the future, I would like to create my own scripts and bundle them with this library, but it will take some time yet.
Thank you.
from openfontrender.
Thanks!
The problem is that I use Linux and that program is only for Windows or Macintosh.
But I found this one called FontForge
Will try to check if it's possible to extract a subset of Fonts. One question: Is not possible to make it smaller reducing the size of the Glyph?
I will try to use this font: Noto
On other GFX tools like Adafruit GFX you can pass the size to the font convert command.
from openfontrender.
Update this Font Forge seems to work correctly in Linux. Now I just need to understand how I will write one of that characters in unicode and it will automatically find it with your library.
Made a fork of the library and added support for Espressif IDF framework:
https://github.com/martinberlin/OpenFontRender-idf
Needed to remove some Serial.prints (Those are supported only in Arduino)
Excluded Arduino.h when a LINUX define is set. The rest where minimal touches and added a CMakeLists file that is needed by IDF components.
from openfontrender.
Great!
Feel free to grab the CMakeList files from my fork. Arduino will ignore it, but CMake based compilers like Espressif IDF will use it to build the component.
I will try the develop branch when it’s ready.
one more question that I still don’t know how it goes:
How does open font render matches a Chinese glyph ex temperature
So temperature today here is:
21.9 温度 C. 76.3 % 湿度
How it finds the glyph in that big array?
Or should I organize them like :
1 = 温
2 = second glyph, etc.
I hope my question is understandable. Basically what I mean is:
How I need to organize the subset of the font in order that is possible to use and that the Asian glyph is matched?
from openfontrender.
Quick question is there a way to invert the background/foreground color?
UPDATE I can set the Font color but the background area where the render is drawing is always black.
I still didn’t get how to get the same gray color I’m using in LovyanGFX GFX with
Display.color888(255,255,255) that should be white in RGB but is an uint32 so maybe is getting lost when converter to uint16 in render.setFontColor
Got it you need to use this:
// For this render to work correctly we need to set both foreground and background color:
// FG RGB, BK RGB
render.setFontColor(255,255,255, 0,0,0);
from openfontrender.
Hi @takkaO
I tried to build develop branch in IDF v5. and this is the first error I found:
1.
../components/OpenFontRender/upstream/src/OpenFontRender.cpp:496:44: error: 'unicode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
496 | if (detect_control_char && unicode == '\n') {
| ~~~~~~~~^~~~~~~
//1 simply solved adding an initializer value: uint16_t unicode = 0; // Line 277
Fixing that it build and works as expected in Espressif IDF provided the CMakeFiles is present.
from openfontrender.
Thanks for the help on this one. Closing since the IDF fix is being handled in the commit comments
from openfontrender.
Related Issues (20)
- 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
- Text alignment seems shifted down about 50% of glyph height HOT 12
- ESP32 crash with certain configuration HOT 1
- Vertical centering with a line break HOT 4
- Recommendations for memory use? HOT 2
- Memory issue HOT 5
- OpenFontRender support for Teensy 4.1 HOT 16
- Recommendations for code changes HOT 2
- OpenFontRenderer memory requirements of loadFont() function HOT 4
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.