Hershey is a textual vector font format

30 points by Internet_Janitor a day ago on lobsters | 14 comments

chrislloyd | a day ago

I’ve been working on a small (in-progress) collection of Hershey fonts if anybody is interested. They’re a little more modern than some of the other faces you’ll find online.

nelson | 23 hours ago

wow this is neat! When I was doing more plotter stuff I was bummed how few fonts there were. Yours are appealingly novel!

It'd be cool to see phoots of how they look when drawn with a plotter and a regular fat pen.

[OP] Internet_Janitor | 23 hours ago

Looks handy!

I especially appreciate that the .jhf files you offer are well-structured. I've discovered that many of the Hershey fonts available online have had their id field set to 12345 for every glyph and include hard-wraps in some glyphs, both of which needlessly make it harder to parse the files and use them for drawing text.

neauoire | 22 hours ago

scruss | 15 hours ago

Kamal Mostafa's hershey-jhf-fix-linebreaks.py fixes the linebreak problem

erikn | 14 hours ago

Those are some great looking fonts!

I recently ran into Hershey fonts and the .jhf file format when fiddling with a Pimoroni Inky e-ink display + raspi controller. The library they supply does provide the "Futural" font if I recall correctly. It all works great except one thing - no Swedish characters (å, ä, ö).

Since you're likely 100x more familiar than I am with Hershey fonts by now, I thought I might just pop the question - have you ever seen a .jhf file with a font that contains say the first 255 chars of the asciitable?

Either my font finding skills are real bad, or there just isn't one out there. I just thought I'd ask in case you had already seen something :)

scruss | 23 hours ago

Note that this is the Usenet Font Consortium (1986) re-spin of the Hershey data, which takes some very 1986 C programmer liberties with the original Calligraphy for Computers (1967, PDF) / [A contribution to computer typesetting techniques : tables of coordinates for Hershey's repertory of occidental type fonts and graphic symbols] (1976) data format. The original Fortran fixed-field format looks much easier to work with (despite the Usenet post's snarky “Not that anybody would really want to use their format …”) but the data tape formerly available from NTIS is presumed lost.

And again, thanks for the reminder that I need to finish/release/abandon my Hershey OTF conversion that I last looked at in 2016 or so: scruss/python-hershey. And hi to everyone who has had a shot at this maddening font format! Here's a new vector font rabbit hole for you: GIMMS, as used at the University of Edinburgh

Frank Grießhammer has some nice words and pictures and Hershey and his work: Frank Grießhammer

bazzargh | an hour ago

One thing I find Hershey fonts handy for is that they're such a simple vector format it's easy to build other effects on top for display, not just pen plotters; eg in AoC 2024, my visualisation for day 5 sampled points from the vectors and used them as nucleation points for bubbles; https://hachyderm.io/deck/@bazzargh/113599143062296178; and on day 12 I stroke the lines slowly to get an effect of writing on a frosted window https://hachyderm.io/deck/@bazzargh/113639456289455465

pralkarz | 8 hours ago

This format might be very handy for the software renderer I'm writing! It's just a toy project, so I don't really want nor need to support OTF/TTF fonts, therefore Hershey fonts seem like a decent, low-cost improvement over what I'm doing currently (monospace bitmap-based fonts inspired by olive.c).

mhd | a day ago

Hmm, no baseline?

[OP] Internet_Janitor | 23 hours ago

The examples I've seen so far seem to vertically align glyphs to a uniform centerline. I suppose you could compute a baseline from the dimensions of a reference character like 0 so long as you have a mapping between glyph ids and ascii/unicode characters.

abetusk | a day ago

A long time ago, I converted Hershey fonts to JSON. It's pretty verbose but easier to process and read. The 2.6Mb file is available here in case anyone wants it.

ocramz | 22 hours ago

the imperative equivalent to (declarative) https://en.wikipedia.org/wiki/Metafont

aanastasiou | 21 hours ago

BGI fonts had a similar structure too.