Note the author had to modify Gimp to get it to run the wasm. It's not something most apps would allow just for font rendering.
He open sourced the exploit concurrent to the website going up, and it was immediately adjusted for use against different targets (including FoxIt reader or something like that on Windows), and as freetype was used by a lot of Linux distributions in addition to iOS I imagine it was used in a ton of malware (which might or might not have been "high profile"). I actually use those vulnerabilities as a case study in the ethical trade offs of open source weaponization in my talks.
(There were two such jailbreaks, as there were/are separate implementations of two similar yet slightly different virtual machine versions, each of which had bugs that I remember to be related to the same fundamental mistake; and--as you can read about in another big thread on this website today, most developers think coming up with difficult abstractions isn't worth their effort and would rather fix things by playing whack-a-mole.)
This makes me nostalgic for bitmap fonts.
Opentype supported ligatures in ‘96. Postscript Type 1 and even Knuth’s TeX supported ligatures to a certain extent.
It’s a pretty standard base-level feature for any sort of typesetting.
Imo this is akin to making a terminal animation by outputting blocks of ascii art. It’s not that terminals added video playback support— which would be bloat—but instead someone pushed a standard feature to a novel extent.
AFAICT this is how it is done (edit: I am wrong, it uses Wasm):
- The frames of the video are simply stored as glyphs in the font
- There is a ligature mapping for sequences of dots to glyphs (for example "." is mapped to glyph 1, ".." is mapped to glyph 2, "..." is mapped to glyph 3, etc.
- If you use the font in an editable part of the browser and hold the "." key pressed, dots get added by autorepeat and a growing a sequence of dots is inserted. This sequence of dots is converted by the font's ligature mapping to different animation frame glyphs, thus showing the animation.
I have no idea why WASM and HarfBuzz are needed (it should work in any modern browser without them), but it looks like a fun little experiment.
I wondered myself about just using "simple" ligatures, but I don't know whether or not it's feasible to statically store several thousand ligature definitions in a font that are each mostly runs of several thousand characters being substituted. But maybe? OpenType has mysterious depths.
Using Wasm for this animation really is an overkill IMHO.
*) https://learn.microsoft.com/en-us/typography/opentype/spec/g...
Edit: IIRC Ligatures are applied recursively, so you can have a ligature based on other ligatures. If I am right here, each ligature can consist only of two glyphs (the glyph of the previous animation frame followed by a dot). This would keep the GSUB table small.
It looks like it uses Wasm to replace a sequence of dots with a glyph from the font, which shows a frame from the animation, similar to ligatures, but using Wasm. You could do the same with storing the svg paths for each animation frame in an array and then using Javascript iterate over and display these paths, but this uses Wasm, HarfBuzz and a font.
The early computer age of the 80s and 90s was merely playing catch-up to established standards. The standards of the 80s and 90s are not what we wanted to achieve ultimately.
Same with cinema: We shot on 4K-equivalent film for the past 100 years, only in the 80s and 90s with the computerization and videotapes we had a temporary standard of 480i, which we have overcome with sheer computer power, and we’re back to where we actually wanted to be in the beginning.
There are font systems that target code and aren't monospace.
An example is Input: https://input.djr.com/ - https://input.djr.com/preview/
The niche seems to be people who like to code without monospace, or who present code without monospace, e.g. in slides or in blog posts. Or if you want typographical consistency between non-code and code, as I understand you are suggesting.
Indeed. https://googleprojectzero.github.io/0days-in-the-wild/0day-R...
How can WASM be in font? Font is a font, not WASM file. It’s a different format
The only way to animate the font is thus to hold down the . key, which you can't really do in a blog post, at least without some custom JavaScript.
- [1] https://learn.microsoft.com/en-us/typography/truetype/hintin...
All communication will be through sequences of SVG images and animations.
[0] https://www.coderelay.io/fontemon.html
[1] https://github.com/mmulet/code-relay/blob/main/markdown/Tuto...
On the other hand, I know enough to know that Chromium uses Harfbuzz and Skia to render a webpage that, in itself, is going to use another instance of Harfbuzz and Skia to render into a canvas element. Intuitively, it feels dirty.
I have used the font "Alte DIN 1451 Mittelschrift" before, and it fits your requirements pretty well.
https://www.1001fonts.com/alte-din-1451-mittelschrift-font.h...
I’m surely missing something btw
- [1] https://en.wikipedia.org/wiki/HarfBuzz - [2] https://www.phoronix.com/news/HarfBuzz-8.0