Tips for experienced webmasters

How to load Google font from your server ?

I recommend you that :

- download your Google font in Google server :

Open the Google Fonts directory, pick your font(s) and add them to a collection. Once you have collected the desired font(s), click the “Download your Collection” link at the top and you’ll get a zip file containing all the requested fonts in TTF format.

- create font face package here with your new font.

https://www.fontsquirrel.com/tools/webfont-generator

- Unzip the package and paste all the code of "stylesheet.css" inside the file "css/custom.css" of your template.

- Inside the package, you have 3 font files too. Paste the font files in the folder "css" of your template (files with .ttf, .woff and .wof2)

- edit the file "index.php" in the root of the template and delete these lines (average line number 60) :

// load all non standard fonts from Google
$defaultFonts = array('Arial', 'Verdana', 'Trebuchet ms', 'Helvetica', 'Georgia', 'Times new roman');
$allFonts = array($font_content, $font_menu, $font_title_slogan, $font_slogan, $font_website_title, $font_h1, $font_h2);
$googleFonts = array_diff($allFonts, $defaultFonts);
foreach ($googleFonts as $loadFont) {
$doc->addStyleSheet('https://fonts.googleapis.com/css?family=' .$loadFont, 'text/css', 'all');
}

Now this font is loaded directly from your server. You can select this font in the list of your Template manager.

Warning : if you use my free responsive slideshow, go to the section "captions" and choose a standard font for title and text (I recommend you to download again the slideshow module to obtain the last version).

If you want use a Google font for your captions, edit the file "tmpl/default.php" in the module (line 59) and delete these lines :

// load all non standard fonts from Google
$defaultFonts = array('Arial', 'Verdana', 'Trebuchet ms', 'Helvetica', 'Georgia', 'Times new roman');
$allFonts = array($font_title, $font_text);
$googleFonts = array_unique (array_diff($allFonts, $defaultFonts));

$i = 0;
$googlecode = '';

foreach ($googleFonts as $loadFont) {
if ($i > 0) {$googlecode .= '|';}
$googlecode .= $loadFont;
$i++;
}

$doc->addStyleSheet('https://fonts.googleapis.com/css?family=' .$googlecode, 'text/css', 'all');

Then, download and load the Google font from your template (see first part)