After setting
Deferred JavaScript Execution: Add The defer Tag To All Script Tags

to Disabled, for the purposes of Masonry JS & Masonry Views module, (breaks with this setting enabled) the Async Font Loader seems to have a bug.

After changing, on page first load, the fallback fonts are loaded and shown, and then on refresh the correct fonts are shown.

No Console errors.
No CSS errors.

We are using settings almost exactly from : https://groups.drupal.org/node/517292, except for the Defer setting above.

Can provide a HAR by email if required or further information.

Thanks for you help in advance!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bamboodigital created an issue. See original summary.

mikeytown2’s picture

mikeytown2’s picture

Category: Bug report » Support request

on page first load, the fallback fonts are loaded and shown, and then on refresh the correct fonts are shown.

If the fix in the above issue doesn't do it I'd like to see a HAR file so this can be further debugged. I can't reproduce this reported bug locally; I will say that if the "Prevent the Flash of Unstyled Text." checkbox is checked this is how it works; fallback used on first load, new font used on next pageload.

  • mikeytown2 committed a4f10c1 on 7.x-2.x
    Issue #2939889 by mikeytown2: Disabling Defer seems to break Async Font...

  • mikeytown2 committed 8c3e355 on 7.x-2.x
    Issue #2939889 by mikeytown2: Disabling Defer seems to break Async Font...
mikeytown2’s picture

Status: Active » Fixed
FileSize
1.8 KB

This puts the loader code above any css; looks like browsers that are not single threaded (firefox & chrome) might parse the css before the js adds the class to the top html tag. Not a lot that can be done here, seems like the use of font-display is the way forward eventually.

This has been committed; reopen if you have more ideas on how to solve this.

mikeytown2’s picture

Status: Fixed » Active

Circling back to this; do all your fonts have a defined fallback? Go to admin/config/development/performance/advagg/font and under NOT Async Loaded in CSS are there any fonts listed?

mikeytown2’s picture

Status: Active » Postponed (maintainer needs more info)
mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Best that can be done for now