HTML5 loading font at runtime


Hej all,
I’ve googled but have’nt found a good answer at my question.
I want to load a font at runtime and use it in a textfield targeting HTML5.
I know I can add this font to my assets, and I can also achieve what i want to do doing it by hand but I wonder if there is an elegant way doing it with openfl at runtime, maybe Font.fromBytes, Font.register ?
Any advice is welcome,
Thanks in advance,


You need to add CSS styles in order for Webfonts to be defined at runtime. I assume there are tools online for loading webfonts spontaneously, if it isn’t too complicated, perhaps we could try and help integrate this?

We have Font.loadFromName that works for webfonts, but that only helps us know when the CSS style is valid… it does not define the CSS to start with. Happy to hear any new information on this :slight_smile: