16x32 font suggestion

35 views
Skip to first unread message

Mike

unread,
Mar 22, 2026, 5:42:28 PM (13 days ago) Mar 22
to jallist
I have a clock program running on a PIC with a 128x32 OLED display.  I recently looked into converting it to use JAL libraries (instead of my own) and ran into a couple issues.

First, I'd suggest the creation of a "numbers only" 16x32 font.  The full 16x32 font is quite large and my application, for example, only needs the numbers.  Ninety-seven characters at 64 bytes per char is a whopping 6028 bytes.  But ten (or in my case twelve) characters is only 768 bytes.  I added a hyphen and a space to mine.  The space I use, for blanking out the leading digit when going from 12:59 to 1:00.  I don't remember why I added the hyphen.  And I did not add a colon, but instead wrote a procedure to print a colon because I didn't like the all of the whitespace on the sides.

Second, the 16x32 glcd font appears to instead be 14x20, so there's unused space.  I think I copied my true 16x32 characters from an Arduino library, but I honestly don't remember.

-Mike

Rob CJ

unread,
Mar 23, 2026, 2:33:31 PM (13 days ago) Mar 23
to jallist
Hi Mike,

We could maken a numbers only font, addressed via 0..9 and some extra characters starting from 10. Which extra characters would that be?

Space ( ), Colon (:), Hypen (-), Degrees (o), Celcius (C), Farenheit (F)? If you maken a clock with a thermometer you might need the number and degrees (BTW. I did not use the right symbol here for degrees). Any other characters for such a numbers only character set?

And about the 16x32 font. It seems that more fonts could be made smaller. So we could keep this larger ones and create smaller ones from that.

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: zondag 22 maart 2026 22:42
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] 16x32 font suggestion
 
--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jallist/1ad53b80-8076-4a2e-9576-3bf958d10630n%40googlegroups.com.

Mike

unread,
Mar 24, 2026, 9:00:45 PM (11 days ago) Mar 24
to jallist
Hi Rob,

Here's a short video of one of my "clock" programs.  I haven't yet added a temperature sensor to it.  The large font is my 16x32 and the small font is a 5x7 font that I'm pretty sure I got from Arduino.  Sorry about the quality, not sure why it's so bad.


Regards,
Mike

Rob CJ

unread,
Mar 25, 2026, 4:00:17 PM (11 days ago) Mar 25
to jal...@googlegroups.com
Hi Mike,

Saw the video so you are using some font characters. Did you copy those locally?

I will have a look later at the 'numbers-only' font. If anybody has suggestions for additional special characters just to support a clock and / or some other digital device that mainly uses numbers (like a thermometer) let me know.

Thanks.

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: woensdag 25 maart 2026 02:00
Aan: jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] 16x32 font suggestion
 

Mike

unread,
Mar 25, 2026, 4:26:50 PM (11 days ago) Mar 25
to jallist
Hi Rob,

Another thing I just remembered...The JALLIB font has the bits oriented horizontally instead of vertically.  The font I'm using is vertical, which, again, I think I got from Arduino.  I thought the SSD1306 and SH1106 has the bits oriented vertically?

Regards,
Mike

Mike

unread,
Mar 25, 2026, 4:40:41 PM (10 days ago) Mar 25
to jallist
I meant to post this before, just as a comparison, for curiosity.  The 16x32 numbers font that I'm using next to the JALLIB 16x32 font.

IMG_2075.JPG

Mike

unread,
Mar 25, 2026, 9:23:33 PM (10 days ago) Mar 25
to jallist
Here is the font file I use.  But, as I said, the bits are oriented differently.  It's setup to write as 4 rows of 16 bytes per row.  I use the SSD1306_16x32FONT_CHARS_OFFSET[] array to avoid the need to calculate the character offset at runtime.

-Mike
ssd1306_16x32_font.jal

Rob CJ

unread,
Mar 27, 2026, 6:04:15 AM (9 days ago) Mar 27
to jallist
Hi Mike,

I made a 'numbers-only' 12x16 font with some extra characters and wrote a program that fakes a clock and a thermometer to show the fonts.

It contains 20 characters so much smaller than a complete font. Since the numbering is not based on the ASCII table, you need some correction in the program.

See attached program with the font and the update of glcd_font and the following video: https://youtube.com/shorts/BkRncgfe6x0

Apparently because it is a short video Youtube makes it a short.

Is this what you are looking for?

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: donderdag 26 maart 2026 02:23
16f1825_glcd_sh1106_number_font.jal
glcd_16x32_numbers_font.jal
glcd_font.jal

Mike

unread,
Mar 27, 2026, 11:27:00 AM (9 days ago) Mar 27
to jallist
Hi Rob,

I'll take a look.  Whether I use that or not I think it's a good addition to the JAL library.  I'm going to try to convert my font to the JAL bit orientation.

By the way, I think YT makes it a Short if it's under 60 seconds *and* the size format meets the criteria.  My video was under 60 seconds but didn't get made into a Short because I recorded it only Canon digital camera.  Yours was probably recorded on an iPhone, as I've noticed that iPhone vids often (always?) get rotated 90 degrees.  Although my Android phone has done that a couple of times.

Regards,
Mike

Mike

unread,
Mar 29, 2026, 9:21:54 PM (6 days ago) Mar 29
to jallist
Hi Rob,

After spending way too much time writing a Python script to convert this, here is my full-size 16x32 numbers font character set.  I have at least two devices that use this font and these are the only digits I use (0 to 9 plus space).

I know you probably spent some time making that numbers font, but it is twice the size of the one I use.  I think it would be difficult to make a decent program fit under 2K of code space with 1280 bytes just for the font.

I don't think I would ever use A, C, F, M, or P in a font that size.  I consider AM/PM and C or F as minor indicators and not needing to be the same size as the digits.  People generally know if it's AM or PM and Celsius or Fahrenheit.  A small flag is all that's needed, if at all.  My bedroom alarm clock is one example.  It has big 7-seg digits for the time, but just an small LED indicator for PM.  And my house thermostat doesn't even show F or C, but just the temperature value.

My own thoughts, of course.

Maybe a flag in the setup to add in the extra characters?  Such as:
const bit  _include_units     = TRUE
const bit  _include_signs    = TRUE

I would definitely put the space as the next character after "9".

Regards,
Mike
out.txt

Rob CJ

unread,
Mar 30, 2026, 1:58:55 PM (6 days ago) Mar 30
to jallist
Hi Mike,

Maybe we should indeed go for 0..9 and space.

Kind regards,

Rob

Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: maandag 30 maart 2026 03:21

Mike

unread,
Mar 30, 2026, 4:21:15 PM (6 days ago) Mar 30
to jallist
Hi Rob,

Yeah, at least for now.  I think characters could be added with flags set in the main program and compiler "if defined" used in the font file.  But with just those ten characters I think I can fit a clock program into the lowly 12F683 which has only 2K of program space.  I'll give it a try soon.

Regards,
Mike

Rob CJ

unread,
Apr 3, 2026, 6:04:25 AM (2 days ago) Apr 3
to jallist
Hi Mike,

I added the font and a sample program to Jallib. I mentioned in de Source of the font  'Font created by Mike' 🙂.


It will be in the next Jallib release. 

Thanks for your help.

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: maandag 30 maart 2026 22:21

Mike

unread,
Apr 3, 2026, 8:39:46 AM (2 days ago) Apr 3
to jallist
Hi Rob,

Sounds good.  I actually didn't create it, though.  I copied it from somewhere and converted the bit orientation to JAL's needed format.  I wish I could remember where I got it, as I could convert the entire character set so.

Regards,
Mike

Mike

unread,
Apr 3, 2026, 6:18:21 PM (2 days ago) Apr 3
to jallist
I successfully tested your sample program on the 12F1840 with a 128x32 SSD1306 display using I2C.  It worked at all three clock speeds (100kHz, 400kHz, 1MHz).  Program is attached.  Here's a video: https://youtu.be/mN6ri1fF2hs

-Mike
12f1840_glcd_ssd1306_number_font.jal

Rob CJ

unread,
Apr 4, 2026, 3:30:25 AM (yesterday) Apr 4
to jallist
Hi Mike,

Nice. I added your sample to Jalllib after adding the header (otherwise validation fails).

Thanks!

Kind regards,

Rob


Van: 'Mike' via jallist <jal...@googlegroups.com>
Verzonden: zaterdag 4 april 2026 00:18
Reply all
Reply to author
Forward
0 new messages