ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2.02k stars 640 forks source link

how to include new created fonts? #176

Closed tofrnr closed 4 years ago

tofrnr commented 6 years ago

hello, I have created a couple of *.h font files with the font creator http://oleddisplay.squix.ch/ and stored them a subfolder "fonts" in the libraries directory:

include <fonts\Monospaced_plain_8.h>

include <fonts\Monospaced_plain_10.h>

include <fonts\Monospaced_plain_12.h>

include <fonts\Monospaced_plain_16.h>

include <fonts\Monospaced_plain_24.h>

unfortunately it does not compile with my example code. Which is the correct way to make it work?

error messages:


Detecting libraries used...
"C:\Program Files (x86)\Arduino\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include" "-IC:\Users\user1\AppData\Local\Temp\arduino_build_678192/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC   -DARDUINO=10805 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU"  -DESP8266 "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\variants\nodemcu" "C:\Users\user1\AppData\Local\Temp\arduino_build_678192\sketch\SSD1306Hellox3cx3d.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include" "-IC:\Users\user1\AppData\Local\Temp\arduino_build_678192/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC   -DARDUINO=10805 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU"  -DESP8266 "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\variants\nodemcu" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\Wire" "C:\Users\user1\AppData\Local\Temp\arduino_build_678192\sketch\SSD1306Hellox3cx3d.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include" "-IC:\Users\user1\AppData\Local\Temp\arduino_build_678192/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC   -DARDUINO=10805 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU"  -DESP8266 "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\variants\nodemcu" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\Wire" "-ID:\Arduino\portable\libraries\esp8266-oled-ssd1306" "C:\Users\user1\AppData\Local\Temp\arduino_build_678192\sketch\SSD1306Hellox3cx3d.ino.cpp" -o "nul"
"C:\Program Files (x86)\Arduino\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include" "-IC:\Users\user1\AppData\Local\Temp\arduino_build_678192/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC   -DARDUINO=10805 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU"  -DESP8266 "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\variants\nodemcu" "-IC:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\Wire" "-ID:\Arduino\portable\libraries\esp8266-oled-ssd1306" "C:\Users\user1\AppData\Local\Temp\arduino_build_678192\sketch\SSD1306Hellox3cx3d.ino.cpp" -o "C:\Users\user1\AppData\Local\Temp\arduino_build_678192\preproc\ctags_target_for_gcc_minus_e.cpp"
D:\SSD1306Hellox3cx3d\SSD1306Hellox3cx3d.ino:34:38: fatal error: fonts\Monospaced_plain_8.h: No such file or directory

 #include <fonts\Monospaced_plain_8.h>

                                      ^

compilation terminated.

Bibliothek Wire in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\Wire  wird verwendet
Bibliothek esp8266-oled-ssd1306 in Version 3.2.7 im Ordner: D:\Arduino\portable\libraries\esp8266-oled-ssd1306  wird verwendet
exit status 1
kosso commented 6 years ago

Try a forward slash? Which might seem odd on Windows, but I think C++ requires it to be forward.

#include <fonts/Monospaced_plain_8.h>

tofrnr commented 6 years ago

what ?? paths in Windows always are by backslashs !! e.g.: // Wifi data from "data\settings.h"

include "data\settings.h"

but perhaps the upper dir has to be addressed

include <..\fonts\Monospaced_plain_8.h>

tofrnr commented 6 years ago

update: as it turns out, if the fonts folder containing the Monospaced_plain_8.h file was moved from libraries\fonts
into the OLED subdirectory libraries\esp8266-oled-ssd1306\, now appearing as libraries\esp8266-oled-ssd1306\fonts\Monospaced_plain_8.h then the include is eventually deteted by #include <fonts\Monospaced_plain_8.h> (edited - typo:, backslash is correct)

squix78 commented 6 years ago

Does that mean we can close this issue?

tofrnr commented 6 years ago

jap, can be closed 8)

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.