Commit 838980e5 authored by allan's avatar allan

add fonts locally and disable google fonts cdn

parent 04658a5c
......@@ -99,6 +99,8 @@ add_action( 'widgets_init', 'intergalactic_widgets_init' );
* Enqueue scripts and styles.
*/
function intergalactic_scripts() {
wp_enqueue_style( 'typography-style', get_template_directory_uri() . '/typography.css', array(), '0.0.1' );
wp_enqueue_style( 'intergalactic-style', get_stylesheet_uri() );
wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' );
......@@ -118,7 +120,6 @@ function intergalactic_scripts() {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_style( 'intergalactic-lato', intergalactic_fonts_url(), array(), null );
}
add_action( 'wp_enqueue_scripts', 'intergalactic_scripts' );
......@@ -126,25 +127,25 @@ add_action( 'wp_enqueue_scripts', 'intergalactic_scripts' );
* Register Google Fonts
*/
function intergalactic_fonts_url() {
$fonts_url = '';
$fonts_url = get_site_url();
/* Translators: If there are characters in your language that are not
* supported by Lato, translate this to 'off'. Do not translate
* into your own language.
*/
$arimo = _x( 'on', 'Lato font: on or off', 'intergalactic' );
if ( 'off' !== $arimo ) {
$font_families = array();
$font_families[] = 'Lato:300,400,700,300italic,400italic,700italic&subset=latin,latin-ext';
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
// $arimo = _x( 'on', 'Lato font: on or off', 'intergalactic' );
//
// if ( 'off' !== $arimo ) {
// $font_families = array();
// $font_families[] = 'Lato:300,400,700,300italic,400italic,700italic&subset=latin,latin-ext';
//
// $query_args = array(
// 'family' => urlencode( implode( '|', $font_families ) ),
// 'subset' => urlencode( 'latin,latin-ext' ),
// );
//
// $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
// }
return $fonts_url;
......
/* Webfont: LatoLatin-Bold */
@font-face {
font-family: 'Lato Bold';
src: url('/wp-content/fonts/LatoLatin-Bold.eot');
src:
url('/wp-content/fonts/LatoLatin-Bold.eot?#iefix') format('embedded-opentype'),
url('/wp-content/fonts/LatoLatin-Bold.woff2') format('woff2'),
url('/wp-content/fonts/LatoLatin-Bold.woff') format('woff'),
url('/wp-content/fonts/LatoLatin-Bold.ttf') format('truetype');
font-style: normal;
font-weight: bold;
text-rendering: optimizeLegibility;
}
/* Webfont: LatoLatin-BoldItalic */
@font-face {
font-family: 'Lato Bold Italic';
src: url('/wp-content/fonts/LatoLatin-BoldItalic.eot');
src:
url('/wp-content/fonts/LatoLatin-BoldItalic.eot?#iefix') format('embedded-opentype'),
url('/wp-content/fonts/LatoLatin-BoldItalic.woff2') format('woff2'),
url('/wp-content/fonts/LatoLatin-BoldItalic.woff') format('woff'),
url('/wp-content/fonts/LatoLatin-BoldItalic.ttf') format('truetype');
font-style: italic;
font-weight: bold;
text-rendering: optimizeLegibility;
}
/* Webfont: LatoLatin-Italic */
@font-face {
font-family: 'Lato Italic';
src: url('/wp-content/fonts/LatoLatin-Italic.eot');
src:
url('/wp-content/fonts/LatoLatin-Italic.eot?#iefix') format('embedded-opentype'),
url('/wp-content/fonts/LatoLatin-Italic.woff2') format('woff2'),
url('/wp-content/fonts/LatoLatin-Italic.woff') format('woff'),
url('/wp-content/fonts/LatoLatin-Italic.ttf') format('truetype');
font-style: italic;
font-weight: normal;
text-rendering: optimizeLegibility;
}
/* Webfont: LatoLatin-Light */
@font-face {
font-family: 'Lato Light';
src: url('/wp-content/fonts/LatoLatin-Light.eot');
src:
url('/wp-content/fonts/LatoLatin-Light.eot?#iefix') format('embedded-opentype'),
url('/wp-content/fonts/LatoLatin-Light.woff2') format('woff2'),
url('/wp-content/fonts/LatoLatin-Light.woff') format('woff'),
url('/wp-content/fonts/LatoLatin-Light.ttf') format('truetype');
font-style: normal;
font-weight: normal;
text-rendering: optimizeLegibility;
}
/* Webfont: LatoLatin-LightItalic */
@font-face {
font-family: 'Lato Light Italic';
src: url('/wp-content/fonts/LatoLatin-LightItalic.eot');
src:
url('/wp-content/fonts/LatoLatin-LightItalic.eot?#iefix') format('embedded-opentype'),
url('/wp-content/fonts/LatoLatin-LightItalic.woff2') format('woff2'),
url('/wp-content/fonts/LatoLatin-LightItalic.woff') format('woff'),
url('/wp-content/fonts/LatoLatin-LightItalic.ttf') format('truetype');
font-style: italic;
font-weight: normal;
text-rendering: optimizeLegibility;
}
/* Webfont: LatoLatin-Regular */
@font-face {
font-family: 'Lato';
src: url('/wp-content/fonts/LatoLatin-Regular.eot');
src:
url('/wp-content/fonts/LatoLatin-Regular.eot?#iefix') format('embedded-opentype'),
url('/wp-content/fonts/LatoLatin-Regular.woff2') format('woff2'),
url('/wp-content/fonts/LatoLatin-Regular.woff') format('woff'),
url('/wp-content/fonts/LatoLatin-Regular.ttf') format('truetype');
font-style: normal;
font-weight: normal;
text-rendering: optimizeLegibility;
}
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