-
Notifications
You must be signed in to change notification settings - Fork 28
OpenFontRender support for Teensy 4.1 #45
Description
Hello, OpenFontRender is great, compliments for that!
I am using OpenFontRender together with TFT_eSPI library (2.5.43).
Using Arduino IDE 2.3.2, I can build the Noto_Font_Demo (https://github.com/takkaO/OpenFontRender/tree/master/examples/TFT_eSPI/Noto_Font_Demo) and run it on ESP32 board using a TFT with an ILI9341 controller.
Unfortunately, I cannot compile the same for a Teensy board (tried versions 3.1, 3.6, 4.1).
I get a linker error, please see below (a few warnings first and the error is at the bottom).
I could not figure out what the problem is. Help fixing this is highly appreciated because I would like to use OpenFontRender in a project with a Teensy board.
Note: Without OpenFontRender, I can successfully build and run projects with Teensy 4.1 (1.59.0), TFT_eSPI (2.5.43), and the same TFT display.
Output from Arduino IDE 2.3.2
\arduino\libraries\OpenFontRender\src\sfnt\ttcmap.c:55:3: warning: 'tt_cmap_init' defined but not used [-Wunused-function]
55 | tt_cmap_init( TT_CMap cmap,
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp: In member function 'uint16_t OpenFontRender::drawHString(const char*, int32_t, int32_t, uint16_t, uint16_t, Align, Drawing, FT_BBox&, FT_Error&)':
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp:774:75: warning: comparison of integer expressions of different signedness: 'int32_t' {aka 'long int'} and 'long unsigned int' [-Wsign-compare]
774 | if (_saved_state.drawn_bg_point.x < (pos.x + (uint32_t)bit->bitmap.width)) {
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp: In member function 'void OpenFontRender::draw2screen(FT_BitmapGlyph, uint32_t, uint32_t, uint16_t, uint16_t)':
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp:1431:83: warning: comparison of integer expressions of different signedness: 'int32_t' {aka 'long int'} and 'long unsigned int' [-Wsign-compare]
1431 | if (_saved_state.drawn_bg_point.x <= (x + _x)) {
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp:1462:75: warning: comparison of integer expressions of different signedness: 'int32_t' {aka 'long int'} and 'long unsigned int' [-Wsign-compare]
1462 | if (_saved_state.drawn_bg_point.x <= (x + _x)) {
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp: In member function 'FT_Error OpenFontRender::loadFont(const char*, uint8_t)':
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp:446:16: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
446 | strncpy(_face_id.filepath, fpath, len);
\arduino\libraries\OpenFontRender\src\OpenFontRender.cpp:443:28: note: length computed here
443 | size_t len = strlen(fpath);
/arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: /arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/thumb/v7e-m+dp/hard\libc.a(libc_a-openr.o): in function `_open_r':
(.text._open_r+0x14): undefined reference to `_open'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1