zeroseven / font_loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Font Loader for TYPO3

With this extension external fonts can be loaded directly into your TYPO3 ecosystem and will be delivered from your local webserver. This often optimizes load time and meets requirements from the GDPR (or German DSGVO).

Installation

Get this extension via composer req zeroseven/font-loader.

Configuration

All you have to do is install the extension. Everything else happens automatically.

What's happening?

External CSS font files from Google Fonts and Fontawesome are being recognized and loaded if they are being included via TYPO3's own CSS includes. For example like so:

page.includeCSS.font = https://fonts.googleapis.com/css?family=Roboto:300,400,500,700

The fonts inside the CSS are being analyzed, downloaded onto your local webserver and linked.

Example:

HTML CSS
Before
<!DOCTYPE html>
<html>
<head>
  <title>Website</title>
  <link href="https://fonts.googleapis.com/css?family=roboto" rel="stylesheet" type="text/css">
</head>
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url("https://fonts.gstatic.com/s/v3/x3dkc4PPZa6L4wIg5cZOEsoBly4.ttf") format('truetype');
}
After
<!DOCTYPE html>
<html>
<head>
  <title>Website</title>
  <link href="/typo3temp/zeroseven/local_fonts/e487a6484.css" rel="stylesheet" type="text/css">
</head>
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: url("/typo3temp/zeroseven/local_fonts/329272c5cc2f278d6e1b30c77.ttf") format('truetype');
}

About


Languages

Language:PHP 100.0%