Skip to main content
Solved

Does Figma API allow us to know font provider

  • January 15, 2025
  • 4 replies
  • 45 views

Malthe Gram

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

Malthe Gram wrote:

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).
View original

4 replies

tank666
  • 4862 replies
  • January 15, 2025

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


Malthe Gram
  • Author
  • New Member
  • 2 replies
  • January 15, 2025
tank666 wrote:

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.


tank666
  • 4862 replies
  • Answer
  • January 15, 2025
Malthe Gram wrote:

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).

Malthe Gram
  • Author
  • New Member
  • 2 replies
  • January 15, 2025

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings