Google Fonts available in editor when creating PDF document?

Hi, I would like to ask for your advice on whether it is possible to use Google fonts or fonts other than those currently available in the text editor in automation when creating a PDF document?

Thank you. :slight_smile:

You should be able to import a Google font and apply it in a code block before the PDF. Then call the code block at the very top of the PDF while in html view.

<style>
@import url('https://fonts.googleapis.com/css2?family=Sekuya&display=swap');
</style>

.sekuya-regular {
  font-family: "Sekuya", system-ui;
  font-weight: 400;
  font-style: normal;
}

Be warned - the TinyMCE editor adds lots of artifacts when toggling between the editor and code view. It’s a known bug.

If I remember correctly, we ended up writing the entire PDF in a code block and then calling it in the PDF itself.

1 Like

@1F2Ns Thank you very much, but I don’t know where to insert it and how to call it… :sweat_smile: I will try.

I got you when I’m on a computer. Give me a few hours

1 Like

Thank you. I figured it out. Performed the calculation

`<style>
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');

body, html, p, h1, h2, h3, h4, h5, h6, div, span, table, td, th, li, strong, em {
font-family: "Source Sans 3", system-ui, sans-serif !important;
}
</style>`

I called it PDFFont and added the @PDFFont variable to the PDF generator right at the beginning and it works!