I’m making a game with Babylonjs which is then compiled with webpack to generate a single JS file at the end (game build). My problem is that I’d like to integrate a font into my game, but at the end I don’t have an html file to link to a font. How can I do this?
Currently, I have a platform with several mini games. Each game contains its own distinct elements. A game is represented by a package in its own right.
There must be some index.html either generated or created by you.
The Babylon GUI is taking font name that was already loaded to the DOM (and correct me if I am wrong, of course :-))
So your best course of action:
(a prestep FTW!) decide whether you want the font to be served in some CDN or as part of your app
create a CSS file loading the font file. Either load from a local file or from the CDN
Let webpack process this CSS. Webpack’s CSS loader will take care of bundling the local font for you.