So if fonts can contain embedded web assembly, how long until someone makes a font that runs doom?
@foone So if WHAT

@mcc @foone https://fox.nexus/@theresnotime/112667464410894991

someone embedded a llm (llama something) in font file.
when using harfbuzz, a TTF font can run WebAssembly. This is commonly used for advanced positioning for difficult scripts like Arabic

Sammy (is a) Fox :nonbinaryFlag: (@[email protected])

ngl the worst bit about https://github.com/fuglede/llama.ttf is the fact you can execute WebAssembly in a font file.

The Fox Nexus

@4censord @mcc This is a bit misleading. TTF fonts can contain instructions in *any* language or IR for *any* purpose. How (or whether at all) those get executed is a different matter.

As I understand it, there's no Wasm support in TrueType and no Wasm running on the TrueType VM either. Rather, it just uses this Harfbuzz feature: https://github.com/harfbuzz/harfbuzz/blob/main/docs/wasm-shaper.md

If this counts as the font ā€˜running’ anything, you could trivially make a Doom font by hacking DosBox into a font rendering engine.

harfbuzz/docs/wasm-shaper.md at main Ā· harfbuzz/harfbuzz

HarfBuzz text shaping engine. Contribute to harfbuzz/harfbuzz development by creating an account on GitHub.

GitHub
@nexvie @mcc would "when using harfbuzz, a TTF font can run WebAssembly. This is commonly used for advanced positioning for difficult scripts like Arabic" be better?

@4censord Yeah, I think that's more clear. Your original post isn't wrong either; I mainly meant to clarify that it's not like TTF has grown some Wasm-feature lately.

Even more precise but uglier, ā€œa TrueType font can contain Wasm code which might be run by some versions of Harfbuzzā€.

For maxim technical correctness, it's hard to do better than simply refer to the (succinct!) ā€˜Usage’ section in https://github.com/fuglede/llama.ttf/blob/master/README.md ;)

llama.ttf/README.md at master Ā· fuglede/llama.ttf

A font for writing tiny stories. Contribute to fuglede/llama.ttf development by creating an account on GitHub.

GitHub