WIP: Adding custom font with same name as a Google font adds Google source too

If I add a custom font with a same name as a Google font (eg. Poppins), Bricks also adds the <link> to load the same font from Google.

While this can be easily be worked around by changing the custom font to another name (eg. Poppins Local), it shouldn’t add the stylesheet <link> in the first place. Users might not be aware of this issue.

Hi @teoeugene,

can you please record a video of your setup, to see a bug?

I suppose you have Google fonts disabled, but Bricks still loads it, if it’s the same name? I’ve tried to replicate it, but I couldn’t, so I guess I have a different setup than you.

Please let me know.

Thanks.

Hi @Matej. I didn’t disable Google Fonts. I’m just not selecting any of the listed Google Fonts.

Here’s a clearer way to reproduce this:

  1. For testing, ensure that there’s no global font selected in the Theme Styles

  2. Add a custom font and name it the same as one of Google’s font. (eg. Poppins)

  3. Create a empty page and place a heading (or any text element) and don’t select any font. Save and inspect the page. There’s no stylesheet <link> to fonts.google.com. So far so good.

  4. Now select the custom font for the heading and save. image.

  5. Inspect the page and you will see the stylesheet <link> to fonts.google.com added even though I’m using a custom font.
    image

  6. Now rename the custom font to something else (“Poppins Local”). There’s no <link> to fonts.google.com anymore.

This was reproduced in the Bricks playground:

Hi,

thank you for this. I was able to replicate the issue and I’ll create an internal bug report.

Thanks,
Matej