How to do hot reloading of fonts?
Posted: 04 Oct 2021, 20:02
Hello
I'm working with Noesis GUI 3.1.1 and Monogames engine. Currently I try to implement the hot reloading of resource files. Hot reloading for XAML is very is easy to solve, but now I struggle a little bit with hot reloading for fonts. The problem for fonts is, that the corresponding method RaiseFontChanged for the hot reloading takes a lot of arguments, like font name, weight, stretch and style. All these information are unknown to the font provider, since the only information the font provider has is the folder and filename. Those infos, which has been provided to OpenFont. But I guess those information are available
What is the recommended way to implement hot reloading of fonts? Should the font provider not only open the font-file, but also parse it to read those information? Or is there any way to receive this information from the Noesis GUI API, after the file stream has been processed?
I would be happy for a hint in the right direction.
Best regards
I'm working with Noesis GUI 3.1.1 and Monogames engine. Currently I try to implement the hot reloading of resource files. Hot reloading for XAML is very is easy to solve, but now I struggle a little bit with hot reloading for fonts. The problem for fonts is, that the corresponding method RaiseFontChanged for the hot reloading takes a lot of arguments, like font name, weight, stretch and style. All these information are unknown to the font provider, since the only information the font provider has is the folder and filename. Those infos, which has been provided to OpenFont. But I guess those information are available
What is the recommended way to implement hot reloading of fonts? Should the font provider not only open the font-file, but also parse it to read those information? Or is there any way to receive this information from the Noesis GUI API, after the file stream has been processed?
I would be happy for a hint in the right direction.
Best regards