Are we able to use Google fonts

Created on 7 August 2023, over 1 year ago
Updated 8 August 2023, over 1 year ago

Problem/Motivation

We have this module working nicely with a custom CSS stylesheet and we are able to theme are PDF creations!

One problem that we have though is that our fonts are not kicking in.

In our normal site theme we are using Google fonts to bring in the "Roboto" and "Roboto Condensed" and "Roboto Mono" fonts using...

      'https://fonts.googleapis.com/css?family=Roboto': { rel: true, type: external, minified: true }
      'https://fonts.googleapis.com/css2?family=Roboto:wght@700': { rel: true, type: external, minified: true }
      'https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700': { rel: true, type: external, minified: true }

In order to use the same in our print.css which is being picked up nicely by the module and DOMPDF combo we have tried adding this to out print.css stylesheet ...

@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700&family=Roboto:ital,wght@0,400;0,700;1,400&display=swap');

...but it does not seems to being picked up and our heading styles are falling back the sans serif.

Have we got this l wrong? Is it not that simple? can anyone help guide us in the right direction?

Thanks

💬 Support request
Status

RTBC

Version

2.13

Component

Documentation

Created by

🇬🇧United Kingdom SirClickALot Somerset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SirClickALot
  • 🇬🇧United Kingdom SirClickALot Somerset

    Aha! If it else anyone around here, it turned out to simply be a matter of syntax.

    Our print.css stylesheet now starts with this...

    @import url('https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Condensed:wght@700&family=Roboto+Mono&display=swap');
    

    ...and we're all good!

  • Status changed to RTBC over 1 year ago
  • 🇬🇧United Kingdom SirClickALot Somerset
Production build 0.71.5 2024