Skip to main content

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?

 

No, the Plugin API does not have methods or properties that provide such data.


No, the Plugin API does not have methods or properties that provide such data.

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.


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:

  1. Creating your own list of fonts;
  2. Periodic updating of this list;
  3. Inability to determine the source (system, custom or shared fonts).

Thank you for suggestion and your inputs. It dosen’t really fit into my needs however. 


Reply