Skip to main content
Question

Font-face in plugin UI


Max_English

Hi!

I’m designing a Figma Plugin and want to use a custom font in my plugin UI. I don’t intend on modifying nodes with this font at all so I don’t care if it’s available for that purpose. I’ve tried doing this the normal way: adding an otf file to my codebase then creating a font-face in my css linking to that file. However, when I use the newly created font-family, the font isn’t loading in the UI. I’m fairly new to figma plugins so I’m not sure what the issue is.

This topic has been closed for comments

8 replies

tank666
  • 4868 replies
  • July 30, 2022

Corey_O_Brien

Tried using a link to Google fonts and I get this error.

Refused to load the stylesheet ‘https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;600&display=swap’ because it violates the following Content Security Policy directive: “style-src ‘unsafe-inline’ ‘unsafe-eval’ data: blob:”. Note that ‘style-src-elem’ was not explicitly set, so ‘style-src’ is used as a fallback.

Any thoughts on how to fix?


tank666
  • 4868 replies
  • November 6, 2023

Corey_O_Brien

I did not, I will try that.


Corey_O_Brien

That didn’t work 😦

It changed the error a bit though. Now I get the following:

Refused to load the font '<URL>' because it violates the following Content Security Policy directive: "font-src <URL> data: blob: <URL>".


Corey_O_Brien

That worked when I added all of the domains. :).

Thanks for the help.


tank666
  • 4868 replies
  • November 6, 2023

I’ve never encountered this error when connecting Google Fonts, and I find it strange because manifest.networkAccess is optional. Therefore, I suggest you contact the Figma support team.


Corey_O_Brien

Yea, I thought it was weird too, but the manifest.networkAccess did work.


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