I take a lot of things for granted when crafting HTML5 games and often neglect sharing the little things that can make life seem a lot nicer as a developer.
One such thing is adding web fonts to a game without going across domains to get the resources.
Here’s the challenge I faced: to use a fancy comic-like font for a game without going to Google’s web font API. In some circumstances this has been problematic for me. So I wanted to include all the font’s resources and necessary CSS within the game package.
I looked over the web for an explanation and found something pretty spot on on Stack Overflow so I’d encourage you to go read it here: Is it possible to load webfonts through the offline storage cache manifest?
Of course the beauty of doing it this way is that you can localise your text data simply.
I recently converted a bunch of games to Japanese for a client with great ease. I store all text in an array in a single file called textdata.js. All I had to ensure was that the textdata.js file was saved in UTF-8 format.