Custom font loading issues with GUI

Hi everyone!

Quick question on the GUI and custom font loading. How to ensure that fonts loaded OR make sure that the GUI refreshes with fonts after they are loaded.

Currently when I am not caching stuff my fonts load with the default font and their position is totally wrong. This is with “disable cache” option in the browser devtools. Without the option, the custom font seems to load fine. It is a bit puzzling since this font is base64 encoded to the html itself but unknown are the ways of the code…

If I hover over the ui buttons, they seem to correct themselves, but the positioning is still wrong, and things like titles don’t work of course:

And finally, this is how it should look:

So, is there a way to at least manually trigger the GUI to recalculate itself or build itself from the scratch? Is this known issue? Or how to ensure browser has properly loaded the fonts?

Thank you in advance :smiling_face_with_three_hearts:

cc @georgie

1 Like

Hi there @Panuchka can you please provide a playground link that I can use to debug?

Without seeing the code I am not sure if this will help, but if you are referring to a textBlock whose font is changing, try setting resizeToFit = true on the textblock (this will help with layout recalculations)