How to install google font on Drupal 7

I added the stylesheet to the .info file and pasted it into the google font url, but in firebug it just shows the whole page indicating that it is not connected correctly. How to link google font in drupal 7?

+5
source share
2 answers

Add this to your template.php file (located in the 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 topic).

And then the correct css code in your css file. Sort of:

body {
  font-family: 'Raleway', sans-serif;
}
+15
source

You could make your life a lot easier simply by using the added Google Fonts module ... it does everything for you and has been proven to work many times.

+1
source

All Articles