Prevent fonts loading globally across entire site

Multiple pages, different fonts for each...

It's a page speed nightmare

:ghost:

I’m working on a project that hosts all my companies advertising campaign landing pages.

We’re using different designs for each page to test creative against certain audiences.

It’s a nightmare however that Webflow pushes all fonts globally, without the ability to set them per page — 40% of our load times are due to the fonts that are loaded, but not used, per page.

The extra script that Webflow adds, globally.

WebFont.load({ google: { families: ["Lato:100,100italic,300,300italic,400,400italic,700,700italic,900,900italic","Vollkorn:400,400italic,700,700italic","PT Serif:400,400italic,700,700italic","Merriweather:300,300italic,400,400italic,700,700italic,900,900italic","Poppins:200,200italic,regular,italic,500,500italic,900,900italic:latin-ext,latin","Nunito Sans:regular,italic,800,800italic,900,900italic"]

Examples of how varied these designs are




So my question is: how can I (perhaps via some fancy custom JS code) prevent fonts from loading per page?

Thanks in advance if you can help me out!

:v:


You can see my project here: (Webflow - Future Super Landing Pages)

@webdev I wonder if you had an educated understanding of what’s going on here and how I might sort out a workaround?

Fonts are loaded at the Site project level, not per page. Therefore you would need to standardize on a font set. You can’t prevent the loading any other way.

Ahhh that’s shame… thanks for letting me know! @webdev

Definitely @webdev is correct that Webflow loads fonts at the site level. However, you might be able to do this with some custom code, like this:

function addGoogleFont(FontName) {
    $("head").append("<link href='https://fonts.googleapis.com/css?family=" + FontName + "' rel='stylesheet' type='text/css'>");
}

addGoogleFont("Junge");

See this thread on SO: dynamically load fonts html jquery - Stack Overflow for the original question and more information.

It will be a somewhat painful process IMO and you won’t be able to see the fonts in designer, you’ll also have to assign them with custom CSS b/c they won’t be in the dropdown.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.