Commit 751d52af authored by Erase's avatar Erase
Browse files

Oups 3/2 o/

parent f10dea25
# goofi
get google fonts onto your server with just one <link>
instead of
<link href="|Roboto" rel="stylesheet">
<link href="goofi.php?family=Nunito+Sans|Roboto" rel="stylesheet">
and the script will get the fonts & css and then save it onto your server. After that, no more queries will be send to google's servers anymore ;-)
header("Content-Type: text/css");
if (!empty($_GET['family'])){
if (!is_dir($font_folder)){mkdir($font_folder);}
if (!is_file($css_filename)){
preg_match_all("#font-family: '(?P<name>[^']+)[^^]*?url\((?P<url>[^\)]+)\)#", $css, $urls);
foreach($urls['url'] as $nb=>$url){
if (!is_file($font_folder.'/'.$font_file)){
file_put_contents($font_folder.'/'.$font_file, $font);
file_put_contents($css_filename,$css );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment