Problem: The first time using a custom font to draw on a canvas results in a default font being used.
How it should work: Fonts should be preloaded and ready for use.
The cause is how fonts are loaded. Custom fonts are not retrieved until something uses them. This means that my canvas tries to draw, calls for the font, while that is loading asynchronously it draws on the canvas using whatever font is on hand, then the font loads later and is available for future use.
That was a quick fix. While loading resources, I create a canvas, append it to document.body, and draw on it once for each font. Then I remove it from the body, and all fonts are requested.
Problem: The first time using a custom font to draw on a canvas results in a default font being used. How it should work: Fonts should be preloaded and ready for use.
The cause is how fonts are loaded. Custom fonts are not retrieved until something uses them. This means that my canvas tries to draw, calls for the font, while that is loading asynchronously it draws on the canvas using whatever font is on hand, then the font loads later and is available for future use.