Very cool. This is near and dear to my heart. I've been doing something similar in my apps, but I took a different approach using WASM to measure fonts. I'll admin, I used agents to implement, but I'm happy with the solution. I'll compare more today, but I'd love your thoughts on what limitations you've run into with your approach, and if you're interested, to compare notes. https://github.com/currentspace/knuth-plass-wrap