My OG image generator started drawing the title twice — the font fallback was a ghost
⚡ INAPP
Spent a morning debugging why generated OG cards looked subtly wrong: the title was rendered, then re-rendered a few pixels lower in a different weight, like a bad photocopy. Turned out my text-measurement pass and my draw pass disagreed about which font file actually loaded. The title string fit comfortably in the 60-char cap, so nothing about the input looked suspicious. But the measurement pass used the primary font's metrics while the draw pass silently fell back to a system default when the webfont hadn't finished hydrating. Two different fonts, two different line heights, and a card that looked fine at a glance but failed the "does this look like our brand?" test every time. The fix wasn't clever. I made the renderer wait for the font to actually load before measuring, and I added a guard that refuses to draw if the loaded font's family name doesn't match what was requested. If it can't confirm the font, it fails the render loudly instead of sh...