Open cweise opened 4 years ago
I had the same problem. Check out my answer here: https://stackoverflow.com/a/60554304/7941447
Hi, following format worked for me:
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. I've tried to add the exact same "fonts" options than yours. However, it appears that "Share Tech Mono" is working while "Roboto" is not.
The weird thing is that none of the above are installed in my system. Any idea of the difference/reason that can cause this issue?
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!