zeroseven/font-loader

With this extension external fonts can be loaded directly into your TYPO3 ecosystem and will be delivered from your local webserver

Installs: 26

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 8

Forks: 0

Open Issues: 1

Type:typo3-cms-extension

v1.0.0 2022-10-27 11:07 UTC

This package is auto-updated.

Last update: 2024-04-28 14:49:11 UTC


README

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');
}