Steven #Wittens’s #SDF #fonts page where he implemented the Euclidean #Distance-Transform to avoid the #Mapbox #TinySDF wobbliness and pixelation problems. Apparently there’s a separable approach to this: “Like a Fourier Transform, you can apply it to 2D images by applying it horizontally on each row X, then vertically on each column Y (or vice versa).” ...really? Holy shit, you just count up with squared distances and everything works, that’s fucking insane. Then he figures out how to make it work with subpixel #antialiasing: “Here’s how I assembled a “true” Euclidean Subpixel Distance Transform.” #algorithms #toread
on 02026-01-12how #Mapbox uses #SDF #fonts for #maps, including “text halos”, with images of the SDF texture atlases, using 192–255 for “inside” negative SDF values. #graphics
on 02026-01-12