Idee ist benötigte Web Fonts bei Google herunterzuladen und in einem Webspaceordner abzulegen. Sowie zugleich CSS etc. Vielleicht mit einem Plugin oder on-the-fly.

Nachtrag: Siehe Joomla-Plugin https://github.com/GHSVS-de/plg_system_importfontsghsvs/releases

Veraltete Notizen

https://www.mittwald.de/blog/mittwald/howtos/dem-datenschutz-zuliebe-wie-ihr-google-fonts-lokal-in-eure-webseiten-einbindet

Dort Service google-webfonts-helper.herokuapp.com bzw. https://github.com/majodev/google-webfonts-helper#rest-api , den ich aber eigentlich nicht nutzen möchte, da vor Verwendung in Echtsystemen gewarnt wird.

https://developers.google.com/fonts/docs/getting_started

Ich habe mir einen Projekt-API-Key angelegt.

AIzaSyC2-qjThVZbmqX2gCbcim5bZQGUs6VKTOI

Siehe auch https://developers.google.com/fonts/docs/developer_api

Folgende Codes habe ich bisher rumprobiert:

User-Agents mit denen man spezifische Font-Formate (woff, woff2...) abfragen kann:

/**
USER_AGENTS: {
// see http://www.dvdprojekt.de/category.php?name=Safari for a list of sample user handlers
// test generation through running grunt mochaTest:src
eot: 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)',
woff: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0',
// must serve complete woff2 file for one variant (no unicode range support yet!)
// see http://www.useragentstring.com/pages/Firefox/
// see http://caniuse.com/#search=woff2
// see http://caniuse.com/#feat=font-unicode-range
// see https://developers.googleblog.com/2015/02/smaller-fonts-with-woff-20-and-unicode.html
woff2: 'Mozilla/5.0 (Windows NT 6.3; rv:39.0) Gecko/20100101 Firefox/39.0',
svg: 'Mozilla/4.0 (iPad; CPU OS 4_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/4.1 Mobile/9A405 Safari/7534.48.3',
ttf: 'Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) Safari/538.1 Daum/4.1'
},
*/

Beachte, dass ein https://fonts.googleapis.com/css?family=Roboto direkt in der Browser-Adresszeile mit aktuelleren Firefox weitaus umfangreicheres Ergebnis ausliefert (alle Subsets), da diese unicode-range unterstützen. Im Vergleich mit unten, wo ältere User-Agents verwendet werden.

Alle Webfonts abfragen, die aber lediglich ttf-URLs enthalten. Gibt JSON zurück

$url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyC2-qjThVZbmqX2gCbcim5bZQGUs6VKTOI';

$wf = file_get_contents($url);

Noch mal suaprobieren. Mir scheint es so, dass man aus den ttf-URLs auch "händisch" woff-URLs ableiten kann, also vielleicht untige Abfragen mit obigen User-Agents gar nicht mehr unbedingt einzeln abfragen muss.

Noch mal ausprobieren, ob ich Header-Übergabe mit Referer hinbekomme (siehe Beispiel nächsten Code), damit ich meinen API-Key im Google-Account nach Domain filtern kann.

Beispiel Abfrage nach woff2 mit einem entsprechenden HEADER (User-Agent)

$url = 'https://fonts.googleapis.com/css?family=Roboto';

$postdata = array(
	'http' => array(
		//'accept' => 'text/css,*/*;q=0.1',
		'header' => 'User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:39.0) Gecko/20100101 Firefox/39.0',
		//'method'  => 'GET',
	//'header'  => 'Content-type: application/x-www-form-urlencoded',
	//'content' => http_build_query(array('input' => $content))))
	)
);
$wf = trim(file_get_contents($url, false, stream_context_create($postdata)));
echo '4654sd48sa7d98sD81s8d71dsa '.print_r($wf,true);exit;