It is difficult to get the size of text when font assets need to load

TextService:GetTextBoundsAsync() is annoying to use because it will always yield if the font is not loaded.

Every time I use this API it’s because I have text and a UI layout computed based on the size of the text which I want to render on the screen immediately. I want something like an API which, if the desired font is not loaded, will instead return the text bounds using the fallback font automatically chosen by the engine and used for rendering TextLabels.

One workaround we can use currently is the trusty old method of getting bounds: reading TextLabel.TextBounds on a dummy label.

DummyLabel.RichText = RichText
DummyLabel.FontFace = FontFace
DummyLabel.Text = Text
DummyLabel.TextSize = TextSize
DummyLabel.Size = UDim2.fromOffset(Width, math.huge)

This workaround is still the most reliable and flexible way to obtain text bounds (it also handles rich text correctly). So having this workaround available makes TextService:GetTextBoundsAsync() effectively useless, except for one thing: knowing when a font asset loads.

That’s another frustrating thing - I’m not aware of any good ways to know when a font asset has become available. I would like to know this information, through a signal or something, so that I can update the UI layout when the rendered font changes. At the moment we have to use TextService:GetTextBoundsAsync() for that, which is not ideal because that also performs other work unnecessarily (computing the text bounds).

Maybe a TextLabel.RenderedFont property will do, though I would prefer something more centralized like a TextService.FontLoaded signal so that I don’t have to make tons of signal connections to something like TextLabel:GetPropertyChangedSignal("RenderedFont") for every single piece of text whose bounds I want to query.

Do the functions in the ContentProvider service not work for fonts? If they do,you could request it be preloaded or query the status