Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a google font on Drupal 7

Tags:

drupal

I added the stylesheet in the .info file and pasted in the url for the google font but in firebug it just shows the entire page indicating that it is not linked correctly. How are google font linked in drupal 7?

like image 515
EZDC Avatar asked Oct 27 '11 16:10

EZDC


1 Answers

Add this in your template.php file (located in theme folder) :

function YOURTHEMENAME_preprocess_html(&$variables) {
    drupal_add_css('http://fonts.googleapis.com/css?family=Raleway:400,100,700', array('type' => 'external'));
}

(replace YOURTHEMENAME with the real name of your theme).

And then the correct css code in your css file. Something like :

body {
  font-family: 'Raleway', sans-serif;
}
like image 101
eZoulou Avatar answered Oct 06 '22 00:10

eZoulou