I have a page that draws a string to a canvas, using a font loaded through @font-face.

To wait for the font to load, I used:
<https://stackoverflow.com/a/11688948/746269>

Which works fine in firefox,
and works in chrome/opera the first time the page is opened
but once I refresh the page, and try to run the same code
it ends up drawing in the default "font not loaded" font
until I run the code a second time.

Unless I open a new window or right click on refresh and choose 'Empty Cache and Hard Reload',
It will always fail the first time through.

I figured perhaps some variable was sticking around between refreshes,
but when I step through despite all values being correct, it draws the default font.

I can't just tell the client to not refresh the page and I can't see a solution at all.
Any help would be greatly appreciated :)