How to do hot reloading of fonts?
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
Re: How to do hot reloading of fonts?
The API for hot-reloading fonts should be changed because as you discovered it is not very easy to use. You need to reload "families" and that's definitely painful.
Font reloading is rare though so for now I would leave it unimplemented till we fix this. Could you please create a ticket about it?
Font reloading is rare though so for now I would leave it unimplemented till we fix this. Could you please create a ticket about it?
Re: How to do hot reloading of fonts?
Thanks for you confirmation, that I did not oversee something. You are right, changing fonts is a rare use-case and I think not implementing hot reloading for fonts for now is ok.
As you suggested, I created a ticket: https://www.noesisengine.com/bugs/view.php?id=2137 I hope the text of the ticket is clear and when you changed the API for this, I will implement the advance font provider according to the new API.
Thanks a lot and best regards.
As you suggested, I created a ticket: https://www.noesisengine.com/bugs/view.php?id=2137 I hope the text of the ticket is clear and when you changed the API for this, I will implement the advance font provider according to the new API.
Thanks a lot and best regards.
Re: How to do hot reloading of fonts?
Thank you very much!
Who is online
Users browsing this forum: No registered users and 85 guests