Lot’s a developers are contacting us to ask about font support and management in CocoonJS. We definitively need to improve our font support but until we fix it, let us comment on how fonts are handled so anyone can use them right now and do not face any more problems:
- Fonts can be either stored in the root folder of your project or inside a folder called “fonts”.
- The font file name and the font reference name inside the application/game code MUST be exactly the same. We know this is not a usual thing to do when handling fonts but it is how CocoonJS works at the moment. Sorry about that.
- In the current version of CocoonJS (1.3), fonts are not loaded when accessing the game using a remote URL. We need to fix this for sure, but fonts are loaded either if a zip file with the project inside is accessed using a remote URL (http://YOU_SERVER_ADDRESS/YOUR_GAME_FOLDER/YOUR_GAME.ZIP) or when a the same zip file is loaded to the device and run from the application list inside the CocoonJS Launcher App. To learn how to upload zip files to the launcher, please read this tutorial.
If you understand and follow these simple rules, you can master font management inside CocoonJS! Good news is that whenever we are able to improve font management inside CocoonJS, your project will still work if you follow these rules and it will definitively work in any browser too. Once again, sorry for the inconveniences. We are trying to improve our platform with every release update but there are still things missing or that need to be fixed.
Happy HTML5 game development!