Add &display=swap to Google Font request
authorJannis Grimm <jannisg@google.com>
Thu, 16 Jan 2020 16:47:00 +0000 (17:47 +0100)
committerGitHub <noreply@github.com>
Thu, 16 Jan 2020 16:47:00 +0000 (17:47 +0100)
This requests Google Fonts to deliver fonts with the `font-display: swap;` CSS option, reducing time until meaningful display epecially on slow connections. Including this option is suggested by default now from Google Fonts.

com.woltlab.wcf/templates/headInclude.tpl

index aaf222d9494f5f1ff381106bf825ab008efced72..f1b590c1b087636240c60184048e69acdad0ee25 100644 (file)
@@ -7,7 +7,7 @@
 
 <!-- Stylesheets -->
 {if $__wcf->getStyleHandler()->getStyle()->getVariable('useGoogleFont')}
-       <link href='//fonts.googleapis.com/css?family={$__wcf->getStyleHandler()->getStyle()->getVariable('wcfFontFamilyGoogle')|urlencode}:400,300,600' rel='stylesheet' type='text/css'>
+       <link href='//fonts.googleapis.com/css?family={$__wcf->getStyleHandler()->getStyle()->getVariable('wcfFontFamilyGoogle')|urlencode}:400,300,600&amp;display=swap' rel='stylesheet' type='text/css'>
 {/if}
 {@$__wcf->getStyleHandler()->getStylesheet()}
 {event name='stylesheets'}