Hello. Do anyone know if I can, through the Figma Plugin API, know if a font is provided by google, a custom font or if it’s a system standard font?
Hello. Do anyone know if I can, through the Figma Plugin API, know if a font is provided by google, a custom font or if it’s a system standard font?
Best answer by tank666
Do you know if theres any way of getting that information? I mean, when I open font selection, there is a filter of google fonts, installed by you etc.
What is available in the Figma UI does not mean that it will be available through the API. So—no, Figma does not have any public APIs that provide information about font sources or selectors in the font picker. But I can suggest you the following way: create your own list of fonts based on available fonts (listAvailableFontsAsync()
), and compare it with this list of available fonts when necessary.
To prevent custom and shared fonts from appearing in the list of available fonts, you need to stop or delete Figma Agent (if you have it installed and running), and call figma.listAvailableFontsAsync()
directly in a file that does not belong to the organization (not located in the organization's workspace). And the best way to do this is in the browser console. This way, your list will contain only Google Fonts.
The disadvantages of the above method are obvious:
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.