I find the new Ubuntu font very readable and will be using it for the main text of the site. The font is located at the Google Font Directory with instructions on how to include it on websites.
I added the following function to functions.php and hooked it to wp_head.
function ubuntu_font() {?> <link href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold' rel='stylesheet' type='text/css'>
<?php}
add_action('wp_head', 'ubuntu_font');
To use the font, just specify ‘Ubuntu’ as the font-family in CSS.
font-family: 'Ubuntu', serif;
That didn’t work for me because of the . I used this solution I hope it’s right. It seems to work thou.
function sourcesans_font () {
$fonturl = “”;
echo $fonturl;
}
add_action(‘wp_head’, ‘sourcesans_font’);
?>
and then in the CSS
body {
font-family: ‘Source Sans Pro’, sans-serif;
}
body.custom-font-enabled {
font-family: ‘Source Sans Pro’, sans-serif;
}
Hi Mauro,
What’s the purpose of echo $fonturl when $fonturl is an empty string?