News for hackers. Stuff that matters.
Re:Leon Sans, a geometric typeface made with code by kccqzy on Sunday September 01, 2019 @04:04PM (#20854512)
It should be noted that Metafont is also a popular system for creating fonts with code. It is even more meta than this because it's a language for creating fonts with code.

When looking at exactly how glyphs are defined (see https://github.com/cmiscm/leonsans/blob/master/src/font/lowe...) it struck me as quite similar to reading raw SVG paths with plenty of magic numbers. It doesn't strike me as particularly "code"-like per se (more like an extremely limited DSL to describe data).

Re:Leon Sans, a geometric typeface made with code by svat on Sunday September 01, 2019 @10:08PM (#20856279)
I upvoted this comment, but sadly I wouldn't call METAFONT a “popular” system. The number of people who have successfully created “true” meta-fonts as Knuth intended is tiny.

Nevertheless, when used with skill it can be very satisfying, as in Knuth's paper that I can only describe as a performance (The Concept of a Meta-Font, https://s3-us-west-2.amazonaws.com/visiblelanguage/pdf/16.1/... ) See also A Punk Meta-Font (https://www.tug.org/TUGboat/tb09-2/tb21knut.pdf) where he describes waking up one morning with an idea to create a certain kind of font, going to the computer at 1pm, and basically being done by 4pm.

It is interesting to see the ideas from METAFONT basically ignored and misinterpreted by most of the mainstream of type designers (despite people like Zapf, Bigelow, Holmes, Carter and Southall being involved with the Stanford typography project and helping Knuth refine Computer Modern), only to be slowly reintroduced decades later in new forms (variable fonts etc).

Re:Leon Sans, a geometric typeface made with code by svat on Monday September 02, 2019 @07:01AM (#20858265)
Forgot to mention: this site https://www.metaflop.com/modulator ought to be better known, and I ought to remember to mention it every time I mention METAFONT.

One great drawback of METAFONT, which held back (still does, but used to too) its adoption in the decades when we could have wonderful things built on it, is the lack of quick visual feedback. (The bigger one of course, is that most font designers don't want to describe their shapes with equations: they think in curves, not about curves.) As I understand it, the site is developed by a couple of enthusiasts and goes a long way to address that problem.

At https://www.metaflop.com/modulator just adjust sliders to create a unique font (or get something random by clicking "flop it!", and then tweak it). You can even download the resulting font if you like it.

Re:Leon Sans, a geometric typeface made with code by fho on Monday September 02, 2019 @10:37AM (#20859326)
> a performance

Yes it was ... bravo!

(No really that was a fantastic read)

Re:Leon Sans, a geometric typeface made with code by userbinator on Sunday September 01, 2019 @05:34PM (#20855090)
The main page of the project says "The font is made with code, it has coordinate values of the drawing points for each type." Indeed, a list of point coordinates and types (on/off curve) is at the core of how every vector graphics format, including font files (which are not much more than collections --- glyphs --- of such graphics) is defined, so that's not saying much.

The main difference with other font formats seems to be that this font is stroked and not filled, which enables a lot of the effects shown; but the "wave" effect is not hard to produce from any other font --- calculate intermediate points if desired, and then repeatedly rasterise using a time-varying random perturbation of each point.

Re:Leon Sans, a geometric typeface made with code by buckminster on Sunday September 01, 2019 @06:00PM (#20855273)
Stroked fonts aren't new of course. See Hershey fonts and plotter fonts in general for examples.
Re:Leon Sans, a geometric typeface made with code by xorcist on Sunday September 01, 2019 @07:02PM (#20855577)
Or indeed Metafont.
Re:Leon Sans, a geometric typeface made with code by foobar_ on Sunday September 01, 2019 @09:27PM (#20856114)
Can't you do the same with svg though ?
Re:Leon Sans, a geometric typeface made with code by shawnz on Monday September 02, 2019 @02:51AM (#20857223)
Or TTF? Aren't all font formats programmable?
Re:Leon Sans, a geometric typeface made with code by necovek on Monday September 02, 2019 @03:27AM (#20857358)
Truetype fonts "on their own" aren't, but they do contain a hinting table which allows one to define "hints" which will reposition curve points based on pixel grid they are being rendered in (a bit simplified).

But no, you can't have multiple weights defined in the truetype format, though certain source font formats surely have them and can generate multiple TTFs.

METAFONT is the ultimate fonts-with-code type system, but I am not sure if non-bitmap font generation tooling has moved away from METAPOST (haven't looked at it in years).

FontForge is scriptable as well, but does not have some of the niceties of MF (like equations which get resolved if possible).

Re:Leon Sans, a geometric typeface made with code by csande17 on Monday September 02, 2019 @04:23AM (#20857566)
OpenType has an extension that allows you to define multiple weights. It doesn't seem nearly as powerful as METAFONT, though; you can just specify a set of offsets to apply to each point in each letter shape: https://docs.microsoft.com/en-us/typography/opentype/spec/ot...