Font for Greiman Library (with Battery Symbols)

Hi,
I have modified the “System5x7.h” font file from the Greiman SSD1306 Library.

Replace the system5x7 font with the one from here: https://github.com/venice1200/TapClock/tree/master/Fonts

Characters 123-127 showing a 5x7 Pixel Battery Symbol with different level.
Characters 91 & 93 showing a very very little PM and AM symbol.

Use oled.print(char(91)); to print the chars to the display.
See:

2 Likes

That’s cool. What characters does it replace?

If I remember correctly [] {} | and two others named „->“ and „<-„.

If the symbols are too small we can make them bigger by creating our own font.

Hi @all,
I have created an new font file including the above symbols (AM/PM/Battery) and some more
for an Block based Watchface.
The last Symbol should be an Bell but looks more as a Space Shuttle :slight_smile:
The first character is Space at Number ASCii 32.
PM is the next at ASCii 33 and so on.
Look into the font file for details.

HowTo
You have two possibities to add the font to the sketch:

  1. Add the font to the SSD1306ASCii Library add the line #include “Clock5x7.h” to
    the file allFonts.h to cover the font. The font must be part of the SSD1306ASCii Library
    file and folder structure.
  2. Add the font to this (or your sketch) by adding an #include "Clock5x7.h"
    and make the file “Clock5x7.h” available through the libraries or inside the sketch folder.
    I keep it in the libraries\SSDFonts folder to use it more than once.

All files and backup of them are available here: https://github.com/venice1200/TapClock/tree/master/Fonts
My old sketches support only the “old” system5x7 font.
All new Version will use the new Clock5x7 Font file.

I am working on a Demo or maybe put it directly into TapClock if I got enough space.

The “old” system5x7 font file can be changed back to original if you use the new one.

1 Like

I have an error message:
‘Clock5x7’ was not declared in this scope


I added #include “Clock5x7.h” there, but for a newbie, I don’t know if this is right.

I asked myself, then I put #include “Clock5x7.h” into “TapClock_v0.6.3.ino” instead of “allFonts.h”.

It is working!

Cool that you got it working :+1:

Double check my modded „allFonts.h“ file where I added the entry for „Clock5x7.h“.
You definitely don‘t need to add the font to TapClock.

Just a second,
where did you save the Clock5x7.h file to ?
It needs to be in the fonts folder of the Display library.
But if it works with „Clock5x7.h“ within the sketch folder and an include in TapClock thats fine as well if it works.

1 Like

It’s here.

Ok, now I understand.

Normally only the file „Clock5x7.h“ should be copied to the original src/fonts folder of the SSD1306Ascii Library and the „allFonts.h“ file from this location is the one which needs to be modfied.
There is no need to copy the whole fonts folder from my github repository to your local libraries folder.

I need to test something when i am back home and re-write the HowTo in the first post and Github.
Maybe i get it working in an easier way.

1 Like

The font looks just stunning:)
PS. I loved the Space Shuttle icon:D

Side note: Calibration is a must for shake wakeup mode. My stats are showing the improvement.

  • Wakes: 10 Views:9

This was

  • wakes: 81 Views: 3

2 Likes

All things are difficult before they are easy. I have been groping myself and succeeded.
It feels like I am back to the student period, it is very nostalgic.

2 Likes

How long ago is this?

Fourth Post updated, see HowTo.