API to list which fonts are available / detect if text has missing font

Fonts are notoriously tricky.
Being able to add character styles in the assets is very cool but…

I’ve deliberately added a missing font and this is what I got in the assets panel:

missing-font

The new style has been correctly added and, obviously, it shows the warning icon.
So, XD knows that the font is not installed.
Is there a way to retrieve such information to be sure that fonts are available before adding them?

This is something we will be adding to the API surface in the future, but currently there’s no way to know if the font is or isn’t available.

… unless you get in to some really hacky text measurement stuff…, which funnily enough is how you’d do it with JavaScript in a browser, too. (Excluding fallbacks)

1 Like

@kerrishotts, any update regarding this topic?
Further, will API support access to system fonts folder in the near future?

We’ve decided to put this feature in the “future” column, which means the request will be addressed next year

1 Like