Hi again
I have just tried to use the " " function to modify a font using this editor GitHub - tchapi/Adafruit-GFX-Font-Customiser: A little utility to customise pixel fonts for the Adafruit GFX library
I copied the output (essentially the same font but with the " . " and "4" glyphs modified) into Notepad++, then saved it as a .h file in the sketch folder as ILSFont.h. That gave an error as ILSFont.h not found in Adafruit_GFX.h folder, so I copied the Adafruit_GFX.h into the sketch
folder and updated the sketch to include "Adafruit_GFX.h" and copied the ILSFont.h file into that particular copy of the library fonts directory.
Using the sketch below, which functioned with other fonts, I substituted the display.setFont callout to display.setFont(&ILSFont); but keep getting not declared errors. The placement and the structure appear the same, but the sketch seems to ignore the copy of the Adafruit_GFX.h library in the sketch folder
Code
#include <Wire.h>
#include <SPI.h>
#include "Adafruit_GFX.h"
#include <Adafruit_SSD1305.h>
//#include "Fonts/FreeMonoBold18pt7b.h"
#include "ILSFont.h"
//#include <Fonts/FreeSerif9pt7b.h>
// Used for software SPI
#define OLED_CLK 13
#define OLED_MOSI 11
// Used for software or hardware SPI
#define OLED_CS 10
#define OLED_DC 8
// Used for I2C or SPI
#define OLED_RESET 9
// software SPI
//Adafruit_SSD1305 display(128, 32, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
// hardware SPI - use 7Mhz (7000000UL) or lower because the screen is rated for 4MHz, or it will remain blank!
Adafruit_SSD1305 display(128, 32, &SPI, OLED_DC, OLED_RESET, OLED_CS, 6000000UL);
// I2C
//Adafruit_SSD1305 display(128, 64, &Wire, OLED_RESET);
void setup() {
Serial.begin(9600);
while (!Serial) delay(100);
Serial.println("SSD1305 OLED test");
if (!display.begin(0x3C)) {
Serial.println("Unable to initialize OLED");
while (1) yield();
}
//display.display(); // show splashscreen
delay(1000);
display.clearDisplay(); // clears the screen and buffer
display.setFont(&ILSFont);
//display.setTextSize(3);
display.setTextColor(WHITE);
display.setCursor(5, 30);
display.println("01.234");
display.display();
}
void loop() {
}
These are the error messages
F:\Users\LES\Documents\Arduino\SSD1306_simple_test_font\SSD1306_simple_test_font.ino: In function 'void setup()':
F:\Users\LES\Documents\Arduino\SSD1306_simple_test_font\SSD1306_simple_test_font.ino:46:20: error: 'ILSFont' was not declared in this scope
display.setFont(&ILSFont);
^~~~~~~
Multiple libraries were found for "Adafruit_GFX.h"
Used: F:\Users\LES\Documents\Arduino\libraries\Adafruit_GFX_Library
Not used: F:\Users\LES\Documents\Arduino\libraries\arduino_196778
exit status 1
Compilation error: 'ILSFont' was not declared in this scope
I've obviously missed something out, despite it being (apparently) the same in structure, what have I mixed up?
Cheers
Les