OpenFontRender
OpenFontRender copied to clipboard
Update to add examples and fix compile problems
I have forked the develop branch and made changes Existing examples have not been updated but I have added some new ones specific to TFT_eSPI Rendering has been speeded up by drawing pixel runs as lines keywords.txt added
- added for architecture in library.properties so examples appear in IDE menu
- sfnt file updated so library compiles for ESP32 with latest board package (which is picky)
Awesome improvement. A before and after video comparison https://twitter.com/martinfasani/status/1591491026656841730
@Bodmer
I am reviewing the code that you has been changed. However, There is one question, so please tell me.
Why did you comment out the sfnt code (ttcmap.c)?
You left the message
sfnt file updated so library compiles for ESP32 with latest board package (which is picky)
, explain more particularly?
(Do you mean the Warning in ESP-IDE?)
The ESP32 board package in the Arduino environment treats some warnings as errors. The commented out function generated a compile warning that the function was "not used" and this was then treated as an error so compile failed. Commenting out the unused funtion fixes this.
@Bodmer
I can't reproduce the issue in my environment, so please give me the following information.
- Arduino IDE version
- Board manager and version
- Target board
- Minimum code that can be reproduced
Screenshots are also acceptable. Thank you.
Arduino IDE version 1.8.13 - but I suspect that does not matter. ESP Ardunio board package 2.0.5 - loaded via board manager Error message:
D:\xxx\Arduino\Sketches\libraries\OpenFontRender\src\sfnt\ttcmap.c:55:3: error: 'tt_cmap_init' defined but not used [-Werror=unused-function]
tt_cmap_init( TT_CMap cmap,
^~~~~~~~~~~~
cc1.exe: some warnings being treated as errors
The later ESP32 board packages are very picky about unused variables and unused functions.
I just noticed that my compiler warnings are set to "All":

So the unused function will not be treated as an error if the warnings are set to "None", "Default" or "More"
The palform.txt specifies the warning/error level and for the ESP32 it is strict for the "All" setting:

@Bodmer
Thanks for the info. I was able to reproduce it in my environment (it seems that other errors were masking the desired error 😭). I also confirmed that the problem can be solved from the Arduino preferences.
This library accepts to change FreeType version, and I think that any modifications to the FreeType code should be made in ModifyLibs.sh/ps1 script.
Therefore, I think I'll pass that any changes to sfnt/ttcmap.c this time.
Other changes will be merged so just a moment, please.
Thank you.
Yes, I think the change to ttcmap.c is not needed and as you say makes a version change clean.