This repository has been archived by the owner on Jun 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 358
How to add a Google Font? #240
Comments
I had the same problem. Check out my answer here: https://stackoverflow.com/a/60554304/7941447 |
Hi, const imageOptions = {
fonts: [
{
url: 'https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2',
format: 'application/font-woff2',
text: "@font-face {font-family: 'Roboto'; font-style: normal; font-weight: 400; src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;}",
},
{
url: 'https://fonts.gstatic.com/s/sharetechmono/v9/J7aHnp1uDWRBEqV98dVQztYldFcLowEFA87Heg.woff2',
format: 'application/font-woff2',
text: "@font-face {font-family: 'Share Tech Mono'; font-style: normal; font-weight: 400; src: local('Share Tech Mono'), local('ShareTechMono-Regular'), url(https://fonts.gstatic.com/s/sharetechmono/v9/J7aHnp1uDWRBEqV98dVQztYldFcLowEFA87Heg.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }",
}
],
}; |
@Andrew6666 I'm facing the same issue. The weird thing is that none of the above are installed in my system. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I am trying to convert a recharts chart svg to a png and I am using a google font for the labels:
When I am saving the svg to an png, the font is not included, means I have a Times New Roman kind of font included. I already tried the fonts option like this:
That was not working.
Thank you for your help!
The text was updated successfully, but these errors were encountered: