Measuring the length of text is really hard. Font fallback is hard. All of these things, you take for granted till you write your own game engine.
Apparently the thing to use is a library with a very strange name, which does glyph placement. I’ll go look for it.
EDIT: harfbuzz https://harfbuzz.github.io/why-do-i-need-a-shaping-engine.ht...