Skip to main content
Question

How to get list of system fonts while developing plugin


Brijesh_Dhanani

I’m developing figma plugin using ReactJS and want to get list of font families that’re installed in computer. Is there any way to get them?

11 replies

Gleb
  • Power Member
  • 4708 replies
  • May 7, 2021

Do you want to get list of font families installed on the computer or the ones that are available in Figma? These are two separate things. I’m not sure how you can get all installed on computer (try to search the web, it won’t be different in a plugin from a normal website. But getting all fonts available in Figma is easy: https://www.figma.com/plugin-docs/api/figma/#listavailablefontsasync


Brijesh_Dhanani

Thanks @Gleb for reply. I want to get list of font families installed on the computer not which are available in figma. I searched a lot in web but didn’t find any solution.

I noticed that figma is using this route for getting local system font families. http://127.0.0.1:44950/figma/font-files which is of local computer path. Can I use that one for the same?


Gleb
  • Power Member
  • 4708 replies
  • May 7, 2021

You probably can’t get local fonts, this is not something web browsers allow you to do. That’s probably why Figma is using the Font Installer app which allows them to use this local system path to get fonts. So if Font installer is installed on the computer, you may be able to use this in the plugin, otherwise no. So your plugin would only work for a portion of users, if this idea would work at all.


Brijesh_Dhanani

Thanks @Gleb ,
Will it be good if I use this path to get fonts http://127.0.0.1:44950/figma/font-files ?


Gleb
  • Power Member
  • 4708 replies
  • May 7, 2021

I’d say no because there are no official apis for this and it could always change without your knowledge and your plugin would stop working entirely, not only for the portion of people.


Brijesh_Dhanani

Okay Thanks.
Then I think there’s no other way to get system fonts right?


Gleb
  • Power Member
  • 4708 replies
  • May 7, 2021

correct


Brijesh_Dhanani

Thanks @Gleb


Guillaume_M

Hi all, hi @Gleb,

I am trying to list all the fonts used in a Figma Files (or in a frame). This would be a subset of the value returned by listAvailableFontsAsync.

Would it be possible to do this without looping over every bit of every texts ?

Thanks a lot !


Gleb
  • Power Member
  • 4708 replies
  • February 3, 2023

No, the only way is to loop through all texts. Luckily you can do that pretty quickly using findAllWithCriteria | Plugin API


Guillaume_M

Hi @Gleb , thanks a lot for your quick reply. i’ll try this.

Bests


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