alphagov / govuk_template

❗️GOV.UK Template is deprecated, and will only receive major bug fixes and security patches. A template containing the GOV.UK header and footer, and associated assets.

Home Page:https://alphagov.github.io/govuk_template/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove debug webfont dependency

duncanhall opened this issue · comments

The main govuk_template.html file has a dependency on vendor/goog/webfont-debug.js. This dependency is bundled with the included assets.

This file seems to be an old debug version of the Google webfont loader. A search for its usage suggests alphagov and its derivatives are the only users: Search for 'google "webfont-debug.js"'.

While it currently serves it's purpose, there might be issues with using an old, debug version of the file. The Google Web Font Loader project suggests loading loading a production version using a CDN such as googleapis.com, jsDelivr or CDNJS. Alternatively, one of these newere, compressed versions could be downloaded and replace the current bundled version.

I’ve done some spelunking, and (although I wasn’t at GDS when this happened), it looks like this file was originally included to help with loading Gill from Monotype. After we stopped using Gill the google JS hung around for IE8 and is still used to load the fonts there. I‘m not aware of any reason why IE8 needs JS to load the EOT fonts it wants, so more investigation is needed as to whether we can just remove that entirely.